Zebreu / ConvolutionalEmotion

A deep convolutional neural network system for live emotion detection
MIT License
42 stars 29 forks source link

Always encounter ImportError #1

Open mavericklam opened 8 years ago

mavericklam commented 8 years ago

Hi dear, when I try to use your code running python zengame.py always encounters ImportERROR that lacking of DecafDet but I did install Decaf correctly, could you please look at that?

Thanks!

Zebreu commented 8 years ago

You might want to show me exactly what the error is like, but I'm guessing that if the statement importing DeCAF returns an error, it's because it's not fully installed. Also, DeCAF should not be used anymore and I suggest you try Caffe (or any similar libraries like Lasagne or Keras).

mavericklam commented 8 years ago

here is the same error I got when I execute python emotionclassification.py WARNING:root:Warning: I cannot import mpi4py. Using a dummpy single noded implementation instead. The program will run in single node mode even if you executed me with mpirun or mpiexec.

We STRONGLY recommend you to try to install mpi and mpi4py.

WARNING:root:mpi4py exception message is: No module named mpi4py WARNING:root:decaf.util.pyvml: unable to load the mkl library. Using fallback options. Traceback (most recent call last): File "emotionclassification.py", line 335, in getPeakFaceFeatures() File "emotionclassification.py", line 65, in getPeakFaceFeatures net = DecafNet() File "/home/lam/Desktop/dl/ConvolutionalEmotion/decaf/scripts/imagenet.py", line 47, in init raise RuntimeError('Cannot find DecafNet files.') RuntimeError: Cannot find DecafNet files.

In addition, how long does it train in order to get you stating accuracy?

Thank you

Zebreu commented 8 years ago

The error says that it needs the DecafNet files, which are the weight matrices used to initialize the network. To my knowledge, they are not available from the original researcher anymore and that is one reason why using Caffe is great: they have a model zoo that includes many pre-trained models (that you can then fine-tune or use as feature extractors). The code is very similar between DeCAF and Caffe.

Training a linear classifier on top of the the convolutional layers is very quick (a few minutes).

mavericklam commented 8 years ago

What code should I change if I move to Caffe, I am running a single node.

Don't I need to train the weight of CNN only the classifier?

Zebreu commented 8 years ago

I don't have the exact lines, but you can look at my other repo to get an idea of Caffe code, it's easy to figure out and useful if you want to get into machine learning.

Fine-tuning can involve training the convolutional layers as well, it's just much slower (and your learning rate generally must be quite slow too), but it's better if you have a large amount of data and this is not the case for facial expressions (the largest datasets I've seen are AFEW/SFEW, SFEW has 700 images).

mavericklam commented 8 years ago

Hmm.. I still don't quite get it. Do you mean you have not train your weight in this case or you are using the weight of existing model?

Anyway I will figure out the Caffe

Zebreu commented 8 years ago

For this project, I did not train any weights, I used them from an existing model (the DeCAF reference model, similar to the AlexNet). I used the first to the sixth layer as a deep feature extractor, producing features usable for any other classifier.

mavericklam commented 8 years ago

Oic, that will be much convenient. I am not sure if caffe has the same model for me to use directly. But anyway, you help is deeply appreciated and very helpful!