0

I am attempting to run some code on github by downloading the repository and running the bash scripts. Here is the repository I'm looking at:

https://github.com/artelab/Multi-modal-classification

I follow the instructions and in order to execute the code I launch cmd as an administrator and run the following:

bash train-on-ferramenta.sh

It executes part of the script correctly, I get the following output.

C:\Users\Multi-modal-classification-master>bash train-on-ferramenta.sh
Downloading images-train.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  148M  100  148M    0     0   342k      0  0:07:24  0:07:24 --:--:--  1063
Downloading images-val.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 48.8M  100 48.8M    0     0   242k      0  0:03:26  0:03:26 --:--:--   741
Downloading text-image-train.csv
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14.0M  100 14.0M    0     0   267k      0  0:00:53  0:00:53 --:--:--  253k
Downloading text-image-val.csv
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4796k  100 4796k    0     0   271k      0  0:00:17  0:00:17 --:--:--  270k
Unpacking images files...
Renaming files...
Starting training process...
Traceback (most recent call last):
  File "scripts/train_model.py", line 5, in <module>
    from dataManagement.DataHelper import DataHelper
ModuleNotFoundError: No module named 'dataManagement'
Done!

I have the dataManagement module in the exact same spot as the repository (the whole thing has just been downloaded so it follows the structure exactly). I have attempted adding a Path variable in Spyder to the project location on my machine, with similar results.

Edit: One thing I have learned through testing, if I open "train_model.py" I am able to execute "from dataManagement.DataHelper import DataHelper" without issue.

user2355903
  • 593
  • 2
  • 8
  • 29
  • Looks like some non-portability with that specific repository. Would be off-topic for SO without a [mcve]. – user202729 Sep 20 '20 at 13:13
  • So what makes this a non minimal reproducible example? I have the github files with complete code linked, and the code I execute and the error it produces. – user2355903 Sep 20 '20 at 13:20
  • MCVE must be included in the question. -- – user202729 Sep 20 '20 at 13:26
  • Based on that thread it seems adding an `__init__.py` file to the subdirectories could help, so I'll play around with that a bit. – user2355903 Sep 20 '20 at 13:40
  • Or mess with PYTHONPATH somehow. – user202729 Sep 20 '20 at 13:41
  • I did already attempt that solution with the same results – user2355903 Sep 20 '20 at 13:42
  • that script should use `python -m script.train_model` instead of `python script/train_model.py` I'll link a duplicate – anthony sottile Sep 20 '20 at 19:07
  • Thanks, that seems to allow me to import from those custom packages... But now it is failing to import tflearn, which is a standard python package. File "/mnt/c/Users/Multi-modal-classification-master/dataManagement/DataHelper.py", line 3, in from tflearn.data_utils import pad_sequences ModuleNotFoundError: No module named 'tflearn' – user2355903 Sep 20 '20 at 19:20

0 Answers0