Comments (12)
The versions that you need for your machine differ, depending on OS and GPU. I did the following, the last time I installed all dependencies for my repositories using Ubuntu 16.04:
CUDA
Download CUDA:
Install CUDA:
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
Add to path:
export PATH=/usr/local/cuda-9.1/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.1/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
cuDNN
Download cuDNN (you need to be registered):
http://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html
Installing from a Tar File:
Navigate to your directory containing the cuDNN Tar file.
Unzip the cuDNN package.
$ tar -xzvf cudnn-9.0-linux-x64-v7.tgz
Copy the following files into the CUDA Toolkit directory.
$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
Theano
Prerequisites:
sudo apt-get install python-dev
sudo apt-get install python-pip
sudo pip install numpy
sudo pip install scipy
sudo apt-get install libblas-dev liblapack-dev
sudo apt-get install cmake
sudo pip install cython
Install gpuarray:
http://deeplearning.net/software/libgpuarray/installation.html
git clone https://github.com/Theano/libgpuarray.git
cd libgpuarray
mkdir Build
cd Build
cmake .. -DCMAKE_BUILD_TYPE=Release # or Debug if you are investigating a crash
make
make install
cd ..
python setup.py build
sudo python setup.py install
python setup.py build_ext -L $MY_PREFIX/lib -I $MY_PREFIX/include
sudo ldconfig
Install Theano:
git clone git://github.com/Theano/Theano.git
cd Theano
sudo pip install -e .
.theanorc
Adjust .theanorc content:
[global]
device=cuda
floatX=float32
optimizer_excluding=low_memory
[mode]=FAST_RUN
[dnn.conv]
algo_bwd_filter=deterministic
algo_bwd_data=deterministic
[gpuarray]
preallocate=0
Lasagne
Last but not least, install Lasagne
sudo pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt
sudo pip install https://github.com/Lasagne/Lasagne/archive/master.zip
You should be able to install all other Python packages needed for the repository without any trouble.
I hope this helps.
from acousticeventdetection.
Thank you very much! I'll give it a try.
from acousticeventdetection.
Did you tested your Neural Network on Ubuntu 16.04 and did it worked @kahst?
from acousticeventdetection.
Yes and no. I'm still using some of the code in my current projects which all run on Ubuntu 16.04. However, you might not be able to use the trained model provided via download - some changes in Theano and Lasagne might prevent that from working. Otherwise, it should run properly - give me a hint if you run into any trouble.
from acousticeventdetection.
(AcousticEvent) bfe2brg@PT-IW002:~/AcousticEventDetection$ python2 AED_test.py --filenames 'dataset/schreien_scream.wav' --modelname 'AED_Example_Run_model.pkl' --overlap 4 --results 5 --confidence 0.01
HANDLING IMPORTS...
WARNING (theano.tensor.blas): Using NumPy C-API based implementation for BLAS functions.
...DONE!
IMPORTING MODEL...
Traceback (most recent call last):
File "AED_test.py", line 156, in
NET, CLASSES, IM_SIZE, IM_DIM = loadModel(TRAINED_MODEL)
File "AED_test.py", line 57, in loadModel
data = pickle.load(f)
File "/usr/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 864, in load
dispatchkey
File "/usr/lib/python2.7/pickle.py", line 1139, in load_reduce
value = func(*args)
File "/home/bfe2brg/.local/lib/python2.7/site-packages/theano/gpuarray/type.py", line 868, in GpuArray_unpickler
raise ImportError("pygpu not found. Cannot unpickle GpuArray")
ImportError: pygpu not found. Cannot unpickle GpuArray
Can you help pls?
from acousticeventdetection.
It seems to me that you are trying to run the model in CPU mode. You need to get gpuarray running before you can load a pickled model. As I mentioned above, even if you have gpuarray installed, you might not be able run the script with the pre-trained model due to changes in Theano and Lasagne. Still, your error messages implies that you are missing gpuarray.
from acousticeventdetection.
(NAME) bfe2brg@PT-IW002:~/AcousticEventDetection$ python2 AED_test.py --filenames 'dataset/schreien_scream.wav' --modelname 'AED_Example_Run_model.pkl' --overlap 4 --results 5 --confidence 0.01
HANDLING IMPORTS...
...DONE!
IMPORTING MODEL...
Traceback (most recent call last):
File "AED_test.py", line 156, in
NET, CLASSES, IM_SIZE, IM_DIM = loadModel(TRAINED_MODEL)
File "AED_test.py", line 57, in loadModel
data = pickle.load(f)
File "/opt/ivs/anaconda/envs/NAME/lib/python2.7/pickle.py", line 1384, in load
return Unpickler(file).load()
File "/opt/ivs/anaconda/envs/NAME/lib/python2.7/pickle.py", line 864, in load
dispatchkey
File "/opt/ivs/anaconda/envs/NAME/lib/python2.7/pickle.py", line 1139, in load_reduce
value = func(*args)
File "/opt/ivs/anaconda/envs/NAME/lib/python2.7/site-packages/theano/gpuarray/type.py", line 865, in GpuArray_unpickler
ctx = get_context(ctx_name)
File "/opt/ivs/anaconda/envs/NAME/lib/python2.7/site-packages/theano/gpuarray/type.py", line 104, in get_context
raise ContextNotDefined("context name %s not defined" % (name,))
theano.gpuarray.type.ContextNotDefined: context name None not defined
I've been able to solve that problem before...The problem is more directed for here now
from acousticeventdetection.
This looks like gpuarray can't access your GPU which might have something to do with drivers&CUDA.
from acousticeventdetection.
@kahst Could you add the specific version requirements of the following libraries:
- Theano
- libgpuarray/pygpu
- Lasagne
Currently git clone git://github.com/Theano/Theano.git
will install Theano 1.0.1, but later on sudo pip install -r https://raw.githubusercontent.com/Lasagne/Lasagne/master/requirements.txt
will install Theano 0.8.2.
Libgpuarray seems to work better with current versions of Theano (~1.0) while Lasagne seems to expect an older one (~0.8.2).
The installation hints you added above unfortunately do not result in a working environment, presumably due to these conflicting Theano requirements.
Currently Lasagne complains about Theano being too new ("missing downsample") and libgpuarray complains about Theano being too old ("major api mismatch between theano and pygpu").
from acousticeventdetection.
@carstenschwede you are right, installing Theano from git results in version 1.0.1. Using pip show pygpu
tells me I'm using version 0.7.5 and pip show lasagne
says version 0.2.dev1.
The change of the requirements.txt in the Lasagne repo is 4 month old, older than the install I'm using. I guess this was already the case when I wrote the instructions and should work.
I'm sorry that I'm not of much help here, but maybe this is an issue for Lasagne, Jan usually responses very quickly.
from acousticeventdetection.
@kahst Thanks for the fast reply. Which Theano version are you using? These are my results:
[email protected]
, [email protected]
and [email protected]
results in the following error at lasagne/layers/conv.py
:
AttributeError: 'Conv2DLayer' object has no attribute 'num_groups'
[email protected]
, [email protected]
and [email protected]
results in the following error at gpuarray/__init__.py
:
Runtimerror: ('Wrong major API version for gpuarray:', 2, 'Make sure Theano and libgpuarray/pygpu are in sync.')
from acousticeventdetection.
Ah, now I know what's going on: The newest version of Lasagne supports grouped convolutions. In that version, all Conv2DLayers have an additional argument named "num_groups". Unfortunately, the snapshot model provided as download contains pickled Conv2DLayer that are outdated.
The test script won't run because of that, you need to train your own net and save that snapshot, before you can actually test on unseen audio files. I'm sorry - for now, that seems to be the only solution.
from acousticeventdetection.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acousticeventdetection.