bloomsburyai / question-generation

Neural text-to-text question generation
MIT License
217 stars 52 forks source link

error running demo #15

Closed zharenkov closed 5 years ago

zharenkov commented 5 years ago

When I'm trying to run demo.sh after setup.sh, I get this error

$ ./demo.sh Traceback (most recent call last): File "./src/demo/app.py", line 6, in <module> from instance import AQInstance File "C:\Users\79270\question-generation\src\demo\instance.py", line 5, in <module> from seq2seq_model import Seq2SeqModel ModuleNotFoundError: No module named 'seq2seq_model'

I tried to install this model using pip install seq2seq_model but this module wasn't found

I also tried to comment import in instance.py but got another error about rl_model Traceback (most recent call last): File "./src/demo/app.py", line 6, in <module> from instance import AQInstance File "C:\Users\79270\question-generation\src\demo\instance.py", line 6, in <module> from rl_model import RLModel ModuleNotFoundError: No module named 'rl_model'

tomhosking commented 5 years ago

Can you try running set PYTHONPATH=%PYTHONPATH%;.\src\ before you run demo.sh? The shell script adds the required directory to your path, but maybe doesn't work on windows.

zharenkov commented 5 years ago

@tomhosking thanks for your responce. I tried to add src dir to my PYTHONPATH. You are right, I'm trying to run it on Windows through git bash

here what i have in my pythonpath

$ echo $PYTHONPATH
C:\Users\79270\Anaconda3\Lib;C:\Users\79270\Anaconda3\DLLs;C:\Users\79270\question-generation\src

but the other error occurs, even if i'm trying to run command from demo.sh like

python ./src/demo/app.py --data_path ./data/ $@

I also tried to add to PATH env variable the location of src, same error

tomhosking commented 5 years ago

Strange! What about if you cd src and run python ./demo/app.py --data_path ./data/ $@?

zharenkov commented 5 years ago

the same -79270@LAPTOP-BN70L650 MINGW64 ~/question-generation/src (master) $ python ./demo/app.py --data_path ./data/ $@ Traceback (most recent call last): File "./demo/app.py", line 6, in <module> from instance import AQInstance File "C:\Users\79270\question-generation\src\demo\instance.py", line 6, in <module> from rl_model import RLModel ModuleNotFoundError: No module named 'rl_model'

tomhosking commented 5 years ago

But that's a bit weird - if it can't find rl_model that means that it successfully imported seq2seq_model. Are you using the latest commit?

zharenkov commented 5 years ago

I suppose so $ git show commit bbd5f4cffdeaf9380ebb0999905a48987e9e76e1 (HEAD -> master, origin/master, origin/HEAD)

tomhosking commented 5 years ago

Could you try running ./.train.sh? That should work without modifying PYTHONPATH