ModuleNotFoundError: No module named 'VUNet'
Closed this issue ยท 9 comments
I tried to follow the steps you provided to explore the data in Data.md
, but when I run
cd <VUNet root>/VUnet/configs/
edexplore -b prjoti.yaml --dataset VUNet.data.prjoti.Prjoti_VUNet_train
I got an error ModuleNotFoundError: No module named 'VUNet'
. I've installed the edflow
and streamlit
successfully.
Running the quick start training command as per README.md
gives me the same error.
Dear @LiUzHiAn, thank you for your comment! I will take a look at this asap.
Just to be sure: Did you pip install the repo? Also, could you post the command you are running together with the console output, so that I can check if I get similar results.
Cheers!
Dear @LiUzHiAn, thank you for your comment! I will take a look at this asap.
Just to be sure: Did you pip install the repo? Also, could you post the command you are running together with the console output, so that I can check if I get similar results.
Cheers!
Hi, jhaux,
I didn't execute the pip install -e .
but install the required packages manually via pip instead. After that, I run the command edexplore -b prjoti.yaml --dataset VUNet.data.prjoti.Prjoti_VUNet_train
(And I'm sure I'm under the right folder, i.e. VUNet/VUNet/configs).
The outputs of the command line were:
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.0.120:8501
And when I turn on my browser, I was told:
ModuleNotFoundError: No module named 'VUNet'
Traceback:
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/streamlit/ScriptRunner.py", line 319, in _run_script
exec(code, module.__dict__)
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/edflow/explore.py", line 141, in <module>
explore(config, disable_cache=opt.disable_cache)
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/edflow/explore.py", line 86, in explore
dset = get_state(config)
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/streamlit/caching.py", line 591, in wrapped_func
return get_or_create_cached_value()
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/streamlit/caching.py", line 575, in get_or_create_cached_value
return_value = func(*args, **kwargs)
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/edflow/explore.py", line 76, in _get_state
Dataset = get_obj_from_str(config["dataset"])
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/site-packages/edflow/util.py", line 25, in get_obj_from_str
return getattr(importlib.import_module(module, package=None), cls)
File "/Users/liuzhian/opt/miniconda3/envs/dl-env/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
Thanks for the quick reply!
I didn't execute the pip install -e . but install the required packages manually via pip instead.
That should be the cause for the error. This way of installing the package also makes sure that python knows not only about the dependencies, but also about the VUNet package. This way it can be imported from anywhere on you computer as long as you are in your virtual environment, where it is installed. I would recommend trying out the pip install -e .
command.
If you cannot do this you can also run all the commands from the repository directory:
edexplore -b VUNet/configs/prjoti.yaml --dataset VUNet.data.prjoti.Prjoti_VUNet_train
All you should need to change is the path pointing to the configs.
Let me know if that helped ๐
Thanks for the quick reply!
I didn't execute the pip install -e . but install the required packages manually via pip instead.
That should be the cause for the error. This way of installing the package also makes sure that python knows not only about the dependencies, but also about the VUNet package. This way it can be imported from anywhere on you computer as long as you are in your virtual environment, where it is installed. I would recommend trying out the
pip install -e .
command.If you cannot do this you can also run all the commands from the repository directory:
edexplore -b VUNet/configs/prjoti.yaml --dataset VUNet.data.prjoti.Prjoti_VUNet_trainAll you should need to change is the path pointing to the configs.
Let me know if that helped ๐
Yes, both methods can solve the problem. Thank you so much!
BTW, I have a question about the VUNet to ask. If I have trained a model, can I just input a stickman image (y_hat in the paper) to generate an RGB image (x in the paper)? Is that right?
Perfect, good to hear!
Concerning your question about VUNet: You always need to pass the model to inputs: One for appearance, i.e. an RGB photo of a person and a stickman. Using this information the model will generate an RGB image.
Take a look at the jupyter notebook VUNet in action.
Concerning your question about VUNet: You always need to pass the model to inputs: One for appearance, i.e. an RGB photo of a person and a stickman. Using this information the model will generate an RGB image.
Take a look at the jupyter notebook VUNet in action.
In my understanding, we need to pass an RGB photo and a pose photo during the appearance transferring phase. But only the pose is needed at the appearance sampling phase. You can refer to >here><< for detail. I think the latten cote z represents the appearance exactly.
You are right, sorry for the confusion. In this case the appearance is sampled using noise. Take a look at the method _latent_sample of the VUnetBottleneck
and how it is used.
So to answer your original question: you still need to pass an appearance to VUNet, but it will be ignored. The code is currently not optimal for doing this kind of operation.