Closed RNarayan73 closed 1 year ago
This is most likely due to how Ray operates (it spawns new python processes, which do not automatically inherit the environment). Try first running ray.init(runtime_env={"env_vars":{"PATH":value}})
before you call any tune-sklearn methods. You can also specify a working_dir
in ray.init
, which will change the working directory of Ray processes.
@Yard1 Thanks for the tip. I used the runtime_env argument with the 'PYTHONPATH' variable which I realised stores the paths for python libraries and it worked.
Hello,
I have saved a number of modules within a subdirectory structure (based on releases) of the location containing the main jupyter notebook.
main script/notebook ! !-- build !---- train !------ module1.py !------ module2.py !---- predict !------ module3.py ! !-- stable !---- train !------ module1.py !------ module2.py !---- predict !------ module3.py
Depending upon the release, I append one of these paths i.e. either build > train or stable > train to the PATH variable within my code to select the appropriate modules within the train package. These folders have an init.py to designate them as packages.
The import calls to the modules themselves use "train." as a prefix so for example:
from train.module1 import <something>
However, TuneSearchCV doesn't seem to search these paths at all. It only looks at the modules and packages that are stored relative to the main notebook's location like so:
main script/notebook ! !-- train !---- module1.py !---- module2.py !-- predict !---- module3.py
Can you please fix this and have it search for modules within the folders of the PATH variable?
Regards Narayan