hls-foundation-os icon indicating copy to clipboard operation
hls-foundation-os copied to clipboard

PYTHONPATH variable error

Open Ni-vik opened this issue 1 year ago • 8 comments

I cloned his repository and followed all the steps given in readme file. After running mim train mmsegmentation --launcher pytorch configs/burn_scars.py

I am getting the following error

You should set PYTHONPATH to make sys.path include the directory which contains your custom module.

I tried setting PYTHONPATH variable. But even after updating the environment variable it is showing the same error

Ni-vik avatar Oct 07 '23 19:10 Ni-vik

The mim command changes the os type to a <class 'mmengine.config.lazy.LazyObject'>, and the path management turns crazy. I've been trying to make it work for the last 24h. So editing the PYTHONPATH doesn't change anything on my side neither.

JulsdL avatar Oct 07 '23 20:10 JulsdL

Hi @Ni-vik and @JulsdL . I am trying to replicate the error, but am not being able to. My first hunch would be to make sure you ran pip install -e . in the repository directory successfully, as that would install the package and any edits to the path should as a result not be necessary.

Could I ask for the full log output you obtain, as well as where you are running the command from?

Could I also ask for the output of pip list from the environment you are using?

CarlosGomes98 avatar Oct 07 '23 21:10 CarlosGomes98

Thank you @CarlosGomes98 . I am running it locally using VS code terminal and CPU device.

I tried installing it again by creating a new environment. After running 'pip install -e .' There were 2 errors (I don't have the complete log though I killed the terminal accidently. I am finding a way to restore the history)

One was related to longfile names. I resolved it from here

Other one was failed to connect to github. Fixed it from here

Now after running mim train mmsegmentation --launcher pytorch configs/burn_scars.py I am getting errors. Here is the complete log

1 2 3 4

Here is my pip list

p1 p2 p3

Ni-vik avatar Oct 08 '23 04:10 Ni-vik

It seems you are running this on windows. I would suggest trying it from windows subsystem for Linux. https://learn.microsoft.com/en-us/windows/wsl/install Windows tends to make things a bit messier with these libraries...

I'd also ask you to check if you correctly installed mmcv-full as per the README, and not mmcv.

If you are running locally and on CPU, you may also want to install the specific versiona of torch and mmcv for CPU. This will be fine for inference, but very slow for fine-tuning however.

CarlosGomes98 avatar Oct 08 '23 06:10 CarlosGomes98

I will try to run it using windows subsystem.

I installed mmcv according to readme and also checked if it is compatible with torch version and cpu device.

torch mmcv

Ni-vik avatar Oct 08 '23 07:10 Ni-vik

Is there any prerequisites we should be aware of before following the setup instructions ? Like, do we need Nvidia CUDA and cuDNN library installed ? Or anything like that ?

JulsdL avatar Oct 08 '23 11:10 JulsdL

Is there any prerequisites we should be aware of before following the setup instructions ? Like, do we need Nvidia CUDA and cuDNN library installed ? Or anything like that ?

If you want to run it on CPU then I don’t think so you need those. But in case of GPUs you might need those installed. @CarlosGomes98 will know better about it.

Ni-vik avatar Oct 08 '23 15:10 Ni-vik

For running on CPU, it is sufficient to install the CPU version of torch and the matching version of mmcv-full.

For running on GPU, you should have the appropriate drivers installed. The torch install should then pull all the necessary CUDNN and CUDA libraries.

CarlosGomes98 avatar Oct 08 '23 15:10 CarlosGomes98