alexlee-gk / video_prediction

Stochastic Adversarial Video Prediction
https://alexlee-gk.github.io/video_prediction/
MIT License
303 stars 65 forks source link

ModuleNotFoundError: no module named 'video_prediction' #8

Closed Lishunkai closed 6 years ago

Lishunkai commented 6 years ago

Hello,

I implemented the steps according to the instructions and then run:

CUDA_VISIBLE_DEVICES=0 python scripts/generate.py --input_dir data/bair \ --dataset_hparams sequence_length=30 \ --checkpoint pretrained_models/bair_action_free/ours_savp \ --mode test \ --results_dir results_test_samples/bair_action_free

Then error occurs: ModuleNotFoundError: no module named 'video_prediction'.

It seems everything is right, but how does it happen? and how to fix this bug?

Thank you.

alexlee-gk commented 6 years ago

Hi, I'm not sure what is the problem without additional information. I reran the script scripts/generate.py in Ubuntu 16.04 with up-to-date libraries and it works out-of-the-box for me.

Lishunkai commented 6 years ago

I have downloaded the pre-trained model, and execute: CUDA_VISIBLE_DEVICES=0 python scripts/generate.py --input_dir data/bair \ --dataset_hparams sequence_length=30 \ --checkpoint pretrained_models/bair_action_free/ours_savp \ --mode test \ --results_dir results_test_samples/bair_action_free

The error information is: Traceback (most recent call last): File "scripts/generate.py", line 20, in from video_prediction import datasets, models ModuleNotFoundError: No module named 'video_prediction'

line 20 in generate.py is: from video_prediction import datasets, models

I think the possible reason is that python cannot recognize video_prediction, so it cannot import datasets and models. How to fix this bug?

Lishunkai commented 6 years ago

I have fixed this bug. It turns out that it works well if I run this command in Pycharm IDE, but the problems will occur if I run in terminal.

alexlee-gk commented 5 years ago

This issue turned out to happen with python >= 3.6 due to a change on how imports are handled. For future reference, the fix is to add the repo's root directory to the PYTHONPATH, e.g. export PYTHONPATH=path/to/video_prediction.