Ghadjeres / DeepBach

code accompanying "DeepBach: a Steerable Model for Bach Chorales Generation" paper
MIT License
500 stars 131 forks source link

ModuleNotFoundError: No module named 'torch' #66

Closed jeusdi closed 3 years ago

jeusdi commented 4 years ago

I'm getting this message:

jeusdi@deep:~/Downloads/DeepBach$ python deepBach.py 
Traceback (most recent call last):
  File "deepBach.py", line 7, in <module>
    from DatasetManager.chorale_dataset import ChoraleDataset
  File "/home/jeusdi/Downloads/DeepBach/DatasetManager/chorale_dataset.py", line 2, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'

I've eprformed succesfully:

$ conda env create --name deepbach_pytorch -f environment.yml
$ bash dl_dataset_and_models.sh

After that this is the content folder:

jeusdi@deep:~/Downloads/DeepBach$ ll
total 98204
drwxr-xr-x 6 jeusdi jeusdi     4096 dic 24 17:58 ./
drwxr-xr-x 3 jeusdi jeusdi     4096 dic 24 17:11 ../
drwxr-xr-x 4 jeusdi jeusdi     4096 dic 24 17:28 DatasetManager/
drwxr-xr-x 2 jeusdi jeusdi     4096 dic 24 17:04 DeepBach/
-rw-r--r-- 1 jeusdi jeusdi     8246 dic 24 17:04 deepBachMuseScore.qml
-rw-r--r-- 1 jeusdi jeusdi     2950 dic 24 17:04 deepBach.py
-rw-r--r-- 1 jeusdi jeusdi 50225895 dic 24 17:26 deepbach_pytorch_resources.tar.gz
-rw-r--r-- 1 jeusdi jeusdi 50225895 dic 24 17:58 deepbach_pytorch_resources.tar.gz.1
-rwxr-xr-x 1 jeusdi jeusdi      304 dic 24 17:04 dl_dataset_and_models.sh*
-rw-r--r-- 1 jeusdi jeusdi      364 dic 24 17:04 Dockerfile
-rwxr-xr-x 1 jeusdi jeusdi      102 dic 24 17:04 entrypoint.sh*
-rw-r--r-- 1 jeusdi jeusdi     1460 dic 24 17:04 environment.yml
-rw-r--r-- 1 jeusdi jeusdi    14296 dic 24 17:04 flask_server.py
drwxr-xr-x 8 jeusdi jeusdi     4096 dic 24 17:04 .git/
-rw-r--r-- 1 jeusdi jeusdi     1350 dic 24 17:04 .gitignore
-rw-r--r-- 1 jeusdi jeusdi     1142 dic 24 17:04 LICENSE
drwxr-xr-x 3 jeusdi jeusdi     4096 dic 24 17:58 models/
-rw-r--r-- 1 jeusdi jeusdi     9707 dic 24 17:04 musescore_flask_server.py
-rw-r--r-- 1 jeusdi jeusdi     5026 dic 24 17:04 README.md

After having installed musescore I'm trying to perform python deepBach.py but I'm getting above message.

Any ideas?

Ghadjeres commented 4 years ago

Run conda activate deepbach_pytorch before running python deepBach.py?