yajiemiao / pdnn

PDNN: A Python Toolkit for Deep Learning. http://www.cs.cmu.edu/~ymiao/pdnntk.html
Apache License 2.0
224 stars 105 forks source link

ImportError: No module named models.dnn #47

Open Document-Data-Analyst opened 7 years ago

Document-Data-Analyst commented 7 years ago

I have downloaded successfully all dependencies required to run pdnn. But when i run the following command from terminal

python pdnn/cmds/run_DNN.py --train-data "train.pickle.gz,partition=600m,random=true" \

it shows an import error message.

As I am new to this learning environment. I seek your help for the purpose to rectify this error.

Regards,

a00achild1 commented 7 years ago

I have the same problem when I try to run the examples/mnist/run.sh the dnn.training.log just show:

Traceback (most recent call last): File "C:/pdnn-master/cmds/run_DNN.py", line 27, in from models.dnn import DNN ImportError: No module named models.dnn

idhamari commented 6 years ago

I have the same error in Ubuntu16, The pythonpath was not defined correctly. I created a demo file as the run scripts in the examples folder, everything works.

 pdnndir=<your path>/pdnn  # pointer to PDNN
 device=cuda*  # the device to be used. set it to "cpu" if you don't have GPUs

export PYTHONPATH=$PYTHONPATH:$pdnndir
export THEANO_FLAGS=mode=FAST_RUN,device=$device,floatX=float32

wget http://www.iro.umontreal.ca/~lisa/deep/data/mnist/mnist.pkl.gz

echo "Preparing datasets ..."
python data_prep.py

python  $pdnndir/cmds/run_DNN.py      --train-data "train.pickle.gz,partition=600m,random=true" \
                                  --valid-data "valid.pickle.gz,partition=600m,random=true" \
                                  --nnet-spec "784:1024:1024:1024:1024:1024:1901" \
                                  --wdir ./  --param-output-file dnn.mdl`