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

create_chainer_model NO RESPONSE #2

Open
dovanchan opened this issue Mar 21, 2017 · 9 comments
Open

create_chainer_model NO RESPONSE #2

dovanchan opened this issue Mar 21, 2017 · 9 comments

Comments

@dovanchan
Copy link

HI:
I had downloaded the VGG_ILSVRC_16_layers.caffemodel in the directory.
But when I run creat_chainer_model.py,It just stop in load model without any change.
Is it a bug? what should I do for this .

@dsanno
Copy link
Owner

dsanno commented Mar 21, 2017

Are there any console messages?
If the console is showing "load VGG16 caffemodel", the program should be loading caffe model file.
It takes several minutes, and please be patient.

@dovanchan
Copy link
Author

dovanchan commented Mar 21, 2017

I have waited about 1 hours, It still no complete the loading~I had tried many times, it still no work

Stop at here:
/chainer-neural-style$ python src/create_chainer_model.py
load VGG16 caffemodel .

@dsanno
Copy link
Owner

dsanno commented Mar 21, 2017

Can you create CaffeFunction instance?
Please confirm if CaffeFunction constructor works as follows:

(on Python interactive shell)
>>> from chainer.links.caffe import CaffeFunction
>>> ref = CaffeFunction('VGG_ILSVRC_16_layers.caffemodel')

If it doesn't work, I think Chainer or protobuf package may not be correctly installed or caffe model file may be corrupted.

@dovanchan
Copy link
Author

dovanchan commented Mar 21, 2017

from chainer.links.caffe import CaffeFunction
ref = CaffeFunction('VGG_ILSVRC_16_layers.caffemodel')
Traceback (most recent call last):
File "", line 1, in
File "/home/cu_00095/.local/lib/python2.7/site-packages/chainer/links/caffe/caffe_function.py", line 133, in init
with open(model_path, 'rb') as model_file:
IOError: [Errno 2] No such file or directory: 'VGG_ILSVRC_16_layers.caffemodel'

Can you tell me where is the correct path for the VGG_ILSVRC_16_layers.caffemodel?
I had tried to put it in /chainer-neural-style or . /chainer-neural-style/src
But it still IOError: [Errno 2] No such file or directory: 'VGG_ILSVRC_16_layers.caffemodel'

@dsanno
Copy link
Owner

dsanno commented Mar 21, 2017

The correct path for VGG_ILSVRC_16_layers.caffemodel is "chainer-neural-style".
In more detail

  1. Put VGG_ILSVRC_16_layers.caffemodel into chainer-neural-style directory.
  2. Move to chainer-neural-style directory
  3. Run Python and create CaffeFunction instance.

You can use os.path.exists to check whether the file exists or not.

@dovanchan
Copy link
Author

dovanchan commented Mar 21, 2017

cu_00095@gtx1080:/chainer-neural-style$ ls
LICENSE README.md src VGG_ILSVRC_16_layers.caffemodel
cu_00095@gtx1080:
/chainer-neural-style$ python src/create_chainer_model.py
load VGG16 caffemodel

cu_00095@gtx1080:~$ python
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.

from chainer.links.caffe import CaffeFunction
ref = CaffeFunction('VGG_ILSVRC_16_layers.caffemodel')
Traceback (most recent call last):
File "", line 1, in
File "/home/cu_00095/.local/lib/python2.7/site-packages/chainer/links/caffe/caffe_function.py", line 133, in init
with open(model_path, 'rb') as model_file:
IOError: [Errno 2] No such file or directory: 'VGG_ILSVRC_16_layers.caffemodel'

I have done these, But it always stop at here
I had tried many times, it still no work

@dovanchan
Copy link
Author

The VGG_ILSVRC_16_layers.caffemodel has exist in the chainer-neural-style,I have checked many times;
But It still have a error for No such file.~ Is it a bug need to be fixed?

just stop at load model~

@dsanno
Copy link
Owner

dsanno commented Mar 22, 2017

Did you check VGG_ILSVRC_16_layers.caffemodel exists on Python shell ?
For example, do these commands work?

>>> import os
>>> os.getcwd()
'/path/to/current/working/directory'
>>> os.path.exists('VGG_ILSVRC_16_layers.caffemodel')
True
>>> f = open('VGG_ILSVRC_16_layers.caffemodel', 'rb')
>>> f.close()

@dovanchan
Copy link
Author

I have put the file "VGG_ILSVRC_16_layers.caffemodel" under '/chainer-neural-style',
But run os.path.exists('VGG_ILSVRC_16_layers.caffemodel') . failed....
What should I do to let the python findout this model~

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