abbypa / NNProject_DeepMask

Deep Neural Network for object segmentation.
187 stars 60 forks source link

How to run on Mac OS ? #10

Open LiutongGenius opened 8 years ago

LiutongGenius commented 8 years ago

I am doing the research of semantic segmentation using convolutional neural network.After reading your paper,I think your codes are very important for me,but my computer system is Mac OS,do you know how to make the codes run on Mac OS?

abbypa commented 8 years ago

I didn't try, but I think that if you succeed in installing theano & keras on Mac OS, the rest will follow (with some variations, maybe).

See here- http://deeplearning.net/software/theano/install.html http://blog.wenhaolee.com/run-keras-on-mac-os-with-gpu/

Please update if you succeed, and how.

LiutongGenius commented 8 years ago

Thanks!I have installed theano & keras on my Mac,and I make sure that keras and cuda run well,what should I do next? I see many .py files in your project,which is the main file and which file should I run to see the outcome shows in the paper?

abbypa commented 8 years ago

Please see my answer in #7.

ryanfb commented 8 years ago

Thanks for those links (and this code!) @abbypa. I assumed since nosetests theano failed on OS X, it didn't work, so I've been doing my development/training under Docker (which is much slower, since GPU access is difficult). However it does have the benefit that you can use the commands from the Dockerfile to see basically what you need to do: https://github.com/ryanfb/NNProject_DeepMask/blob/docker_experimental/Dockerfile

ryanfb commented 8 years ago

FWIW, I can get the Keras imdb_cnn.py example running with the Theano GPU backend under OS X, but every time I try EndToEnd.py with a GPU I get a memory allocation error no matter how small I shrink the training/test set: https://gist.github.com/ryanfb/cd0a9980e8ed3e703843079ed4fada7d

I also got the same error trying to run EndToEnd.py with the Theano GPU backend on an AWS EC2 g2.2xlarge instance (running Ubuntu, without Docker). Since both that and my Mac only have 4GB of GPU memory, it seems like more is needed (and since the g2.8xlarge instance just adds more 4GB GPUs, I don't think that would fix it). I also tried the memory optimizations in the Theano FAQ to no avail. CPU backend seems to run fine, but it's relatively slow, and I haven't yet investigated OpenMP with Theano on OS X.

LiutongGenius commented 8 years ago

I'm basically clear about the process.Afer Installed all requirements and Download mscoco annotations,I have a problem with the step "CreateVggGraphWeights.py",I've download the weights file and put it into resources,then I runned CreateVggGraphWeights.py,the command line outputs as below,

File "CreateVggGraphWeights.py", line 150, in graph.set_weights(model.get_weights()) File "/usr/local/lib/python2.7/site-packages/keras/engine/topology.py", line 841, in set_weights params = self.trainable_weights + self.non_trainable_weights File "/usr/local/lib/python2.7/site-packages/keras/engine/topology.py", line 1917, in trainable_weights for layer in self.layers: AttributeError: 'Graph' object has no attribute 'layers'

@abbypa @ryanfb

ryanfb commented 8 years ago

@LiutongGenius That error likely means you have a newer (non-backwards-compatible) version of Keras installed. Try pip uninstall keras && pip install -I keras==0.3.1.