akaraspt/deepsleepnet

Error in download_physionet.sh and prepare_physionet.sh

Closed this issue · 10 comments

Hi,

I get the following error if I write the command ./download_physionet.sh

./download_physionet.sh: line 1: wget: command not found
./download_physionet.sh: line 2: wget: command not found
...

and get also an error at the command python prepare_physionet.py --data_dir data --output_dir data/eeg_fpz_cz --select_ch 'EEG Fpz-Cz'

Traceback (most recent call last):
  File "prepare_physionet.py", line 13, in <module>
    import pandas as pd
ImportError: No module named pandas

What can be the Problem? Where is my mistake?

Thanks in advance.

Hi,

The first error might be solved by running the following command to install wget:
sudo apt-get install wget

For the second error, you can use the following command to install pandas Python package:
pip install pandas

Hope this can fix your errors.

Akara

Hi,

thanks for your quick response.

I have tried your command to install wget, but got this answer:
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/bin/apt" (-1)

I found out, that macOS Sierra doesn't support apt, so than I found this solution.
[https://stackoverflow.com/questions/33886917/how-to-install-wget-in-macos-capitan-sierra]
I have forgot to say that I use macOS Sierra.

The command pip install pandas also doesn't work on my mac.
So i use sudo pip install pandas, but get the following answer:
sudo: pip: command not found

Hi,

i found out, that I should install pip at firs, so I use the command
pip install –U pip

But the command pip install pandas or sudo pip install pandas doesn't work still not

Hi,

It seems that this is the installation problem. I would suggest you to install miniconda2, which is used to create virtual environments for python.

After you have installed miniconda2, you should be able to create a virtual environment via:

conda create -n deepsleepnet python

Then you activate the virtual environment using:

source activate deepsleepnet
pip install numpy scipy pandas matplotlib scikit-learn
pip install <other python library>

Then following the instruction in this link to install Tensorflow r0.12

Once you finish with the experiment with deepsleepnet, you can exit the virtual environment via:

source deactivate

Hope this help

Hi,

I have really problem with the installation, so I deleted all the stuffs that i downloaded and wanted to start at the begin.

Thanks for you suggest.

Hi,

now, I get the following error of the command

python prepare_physionet.py --data_dir data --output_dir data/eeg_fpz_cz --select_ch 'EEG Fpz-Cz'


File "prepare_physionet.py", line 136
    print "Include onset:{}, duration:{}, label:{} ({})".format(
                                                                                  ^
SyntaxError: invalid syntax

It seems, there is a problem with the quotation marks or am I wrong?

Hi,

Which python version you are currently using?

My guess is that you are using Python 3, which requires brackets around the print command.

You can try to change from:
print "Include onset:{}, duration:{}, label:{} ({})".format(...)
to:
print("Include onset:{}, duration:{}, label:{} ({})".format(...))

Hi,

yes I have Python 3.
The mistake was really the requires brackets. Thanks.
But it's better to switch to Python 2. Because there are other bugs that Python 3 doesn't support.

Hi,

now I have a problem with the command:

python train.py --data_dir data/eeg_fpz_cz --output_dir output --n_folds 20 --fold_idx 0 --pretrain_epochs 100 --finetune_epochs 200 --resume False

I get the error:


File "train.py", line 6, in <module>
    import tensorflow as tf
  File "/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 60, in <module>
    raise ImportError(msg)
ImportError: Traceback (most recent call last):
  File "/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 49, in <module>
    from tensorflow.python import pywrap_tensorflow
  File "/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 28, in <module>
    _pywrap_tensorflow = swig_import_helper()
  File "/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/pywrap_tensorflow.py", line 24, in swig_import_helper
    _mod = imp.load_module('_pywrap_tensorflow', fp, pathname, description)
ImportError: dlopen(/Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so, 10): Library not loaded: @rpath/libcudart.8.0.dylib
  Referenced from: /Users/2B/anaconda2/envs/deepsleepnet/lib/python2.7/site-packages/tensorflow/python/_pywrap_tensorflow.so
  Reason: image not found


Error importing tensorflow.  Unless you are using bazel,
you should not try to import tensorflow from its source directory;
please exit the tensorflow source tree, and relaunch your python interpreter
from there.

I already install trensorflow, but i don't understand the error.

Thanks

It seems you have problem with the tensorflow installation. Try to reinstall Tensorflow v0.12 and try again.