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

Error when converting VGG16_SOD from caffe to tensorflow #27

Closed
seanchung2 opened this issue Dec 21, 2017 · 5 comments
Closed

Error when converting VGG16_SOD from caffe to tensorflow #27

seanchung2 opened this issue Dec 21, 2017 · 5 comments
Assignees
Labels

Comments

@seanchung2
Copy link

Hi,

Here's the model: link

Again this happens when trying to convert from IR to tensorflow, but with different error code:

Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/tensorflow/imagenet_test.py", line 68, in <module>
    tester = TestTF()
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/tensorflow/imagenet_test.py", line 16, in __init__
    super(TestTF, self).__init__()
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/imagenet_test.py", line 119, in __init__
    self.MainModel = __import__(self.args.n)
  File "VGG16_SOD.py", line 81
    fc8-SOD100_0    = tf.contrib.layers.flatten(relu7)
SyntaxError: can't assign to operator

Can you please check it out?

Thank you.

@kitstar kitstar added the bug label Dec 21, 2017
@kitstar kitstar assigned kitstar and unassigned TobeyQin Dec 21, 2017
@kitstar
Copy link
Contributor

kitstar commented Dec 21, 2017

Hi @seanchung2.

Fixed. Please update to newest code. Thanks very much.

Command:

$ python -m mmdnn.conversion._script.convertToIR -f caffe -d kit_imagenet -n deploy.prototxt -w VGG16_SOD_finetune.caffemodel

$ python -m mmdnn.conversion._script.IRToCode -f tensorflow -n kit_imagenet.pb -d kit_imagenet.py -w kit_imagenet.npy

$ python -m mmdnn.conversion.examples.tensorflow.imagenet_test -n kit_imagenet.py -w kit_imagenet.npy --dump ./vgg19_sod.ckpt

Tensorflow file is saved as [./vgg19_sod.ckpt], generated by [kit_imagenet.py] and [kit_imagenet.npy].

@kitstar kitstar closed this as completed Dec 22, 2017
@Siddhant24
Copy link

On running the last command I get this error

Traceback (most recent call last):
  File "/usr/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/sid/MMdnn/mmdnn/conversion/examples/tensorflow/imagenet_test.py", line 106, in <module>
    raise ValueError("Need to provide the model type of Tensorflow model.")
ValueError: Need to provide the model type of Tensorflow model.

@namizzz
Copy link
Contributor

namizzz commented Jun 20, 2018

Hi @Siddhant24
Now the way of dumping tensorflow model updates. You need to add "--dump_tag SERVING or TRAINING." .Here is README

@Siddhant24
Copy link

Siddhant24 commented Jun 21, 2018

@namizzz Yes that fixed the error. But instead of the messageTensorflow file is saved as [./vgg19_sod.ckpt], generated by [kit_imagenet.py] and [kit_imagenet.npy]., I get the following message Tensorflow file is saved as [b'vgg19_sod.ckpt/saved_model.pb'], generated by [kit_imagenet.py] and [kit_imagenet.npy].

@mtsol
Copy link

mtsol commented Nov 11, 2018

i cannot solve the error, and it is not solved at any of issues
File "c:\users\mba\anaconda3\lib\site-packages\mmdnn\conversion_script\conver
tToIR.py", line 89, in _convert
from mmdnn.conversion.pytorch.pytorch_parser import PytorchParser
File "c:\users\mba\anaconda3\lib\site-packages\mmdnn\conversion\pytorch\pytorc
h_parser.py", line 12, in
from mmdnn.conversion.pytorch.pytorch_graph import PytorchGraph
File "c:\users\mba\anaconda3\lib\site-packages\mmdnn\conversion\pytorch\pytorc
h_graph.py", line 12, in
from torch.jit import _unique_state_dict
ImportError: cannot import name '_unique_state_dict'

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

No branches or pull requests

6 participants