You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🐛[BUG]: Google Colab & Hydra: MissingConfigException: Primary config directory not found. Check that the config directory '/tmp/ipykernel_3309' exists and readable
#194
Open
josealvarez97 opened this issue
Sep 29, 2024
· 3 comments
The following code used to work on Google Colab for months, then it just stopped working. Not just for me, but for some colleagues as well. Did Google Colab (or the authors of Hydra or Nvidia Modulus) release an update that broke something?
It doesn't make sense that the library searches for /tmp/ipykernel_3309. That's not the current working directory, I already checked that in multiple ways. The default CWD in Google Colab is /content (always).
importmodulus.symfrommodulus.sym.hydraimportto_yamlfrommodulus.sym.hydra.utilsimportcomposefrommodulus.sym.hydra.configimportModulusConfigcfg=compose(config_path="./", config_name="config")
cfg.network_dir="outputs"# Set the network directory for checkpointsprint(to_yaml(cfg))
WARNING:modulus.sym.hydra.config:TorchScriptdefaultisbeingturnedoffduetoPyTorchversionmismatch.
---------------------------------------------------------------------------MissingConfigExceptionTraceback (mostrecentcalllast)
/tmp/ipykernel_3309/3114539013.pyin<cellline: 6>()
4frommodulus.sym.hydra.configimportModulusConfig5---->6cfg=compose(config_path="./", config_name="config")
7cfg.network_dir="outputs"# Set the network directory for checkpoints8print(to_yaml(cfg))
6frames/usr/local/lib/python3.10/dist-packages/hydra/_internal/config_loader_impl.pyin_missing_config_error(self, config_name, msg, with_search_path)
100returnmsg101-->102raiseMissingConfigException(
103missing_cfg_file=config_name, message=add_search_path()
104 )
MissingConfigException: Primaryconfigdirectorynotfound.
Checkthattheconfigdirectory'/tmp/ipykernel_3309'existsandreadable
As I mentioned, I already checked the CWD on Google Colab and that's indeed /content.
For example,
!pwd
outputs /content
and
importosprint(os.getcwd())
outputs /content
I would be happy to just set an absolute path and keep working, but Hydra doesn't allow that).
---------------------------------------------------------------------------HydraExceptionTraceback (mostrecentcalllast)
/tmp/ipykernel_3309/3091310842.pyin<cellline: 6>()
4frommodulus.sym.hydra.configimportModulusConfig5---->6cfg=compose(config_path="/content/", config_name="config")
7cfg.network_dir="outputs"# Set the network directory for checkpoints8print(to_yaml(cfg))
1frames/usr/local/lib/python3.10/dist-packages/hydra/initialize.pyin__init__(self, config_path, job_name, caller_stack_depth, version_base)
8081ifconfig_pathisnotNoneandos.path.isabs(config_path):
--->82raiseHydraException("config_path in initialize() must be relative")
83calling_file, calling_module=detect_calling_file_or_module_from_stack_frame(
84caller_stack_depth+1HydraException: config_pathininitialize() mustberelative
Has anyone come across this issue recently? Any workarounds? Is there actually a way to force Hydra to take an absolute path in the compose function? Any Google Colab experts who understand why Hydra could be pointint to the /tmp folder and not the current working directory (which is /content)?
The text was updated successfully, but these errors were encountered:
Version
1.5.0
On which installation method(s) does this occur?
No response
Describe the issue
The following code used to work on Google Colab for months, then it just stopped working. Not just for me, but for some colleagues as well. Did Google Colab (or the authors of Hydra or Nvidia Modulus) release an update that broke something?
It doesn't make sense that the library searches for
/tmp/ipykernel_3309
. That's not the current working directory, I already checked that in multiple ways. The default CWD in Google Colab is/content
(always).As I mentioned, I already checked the CWD on Google Colab and that's indeed
/content
.For example,
outputs
/content
and
outputs
/content
I would be happy to just set an absolute path and keep working, but Hydra doesn't allow that).
The following Modulus Guide for Jupyter Notebooks is therefore no longer applicable: https://docs.nvidia.com/deeplearning/modulus/modulus-sym-v110/notebook.nbconvert.html. There needs to be a fix or workaround to keep using the library in the way they recommend when working on Google Colab.
Minimum reproducible example
Here is a Google Colab Notebook that can serve as an example. It's a Gist that used to work (I created it months ago), but as of September 2024, it doesn't work anymore if one runs it normally because of this issue: https://colab.research.google.com/gist/josealvarez97/28c4a8ab0e6dbccd4cb5e9b27641858d/nvidia-modulus-navier-stokes-tutorial-physics-informed-neural-networks.ipynb
Relevant log output
No response
Environment details
No response
Other/Misc.
Has anyone come across this issue recently? Any workarounds? Is there actually a way to force Hydra to take an absolute path in the
compose
function? Any Google Colab experts who understand why Hydra could be pointint to the/tmp
folder and not the current working directory (which is/content
)?The text was updated successfully, but these errors were encountered: