Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always encounter ImportError #1

Open
mavericklam opened this issue Nov 20, 2015 · 8 comments
Open

Always encounter ImportError #1

mavericklam opened this issue Nov 20, 2015 · 8 comments

Comments

@mavericklam
Copy link

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
Copy link
Owner

Zebreu commented Nov 20, 2015

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
Copy link
Author

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
Copy link
Owner

Zebreu commented Nov 20, 2015

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
Copy link
Author

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
Copy link
Owner

Zebreu commented Nov 20, 2015

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
Copy link
Author

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
Copy link
Owner

Zebreu commented Nov 21, 2015

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
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants