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

Convert Special ResNet101 from TensorFlow to PyTorch #31

Closed
ahkarami opened this issue Dec 23, 2017 · 1 comment
Closed

Convert Special ResNet101 from TensorFlow to PyTorch #31

ahkarami opened this issue Dec 23, 2017 · 1 comment

Comments

@ahkarami
Copy link

Dear @kitstar,
By using your complete tutorial I can convert ResNet V1 101 model (from TF-Slim) to PyTorch, and the converted model works correct. Now I want to convert another ResNet V1 101 model which has 5,000 classes from TensorFlow to PyTorch. In fact, I want to convert the pre-trained Open Images ResNet V1 101 from TensorFlow to PyTorch.
To this end, I have tested with follow steps:

  1. Download resnet_v1_101 data:
$ wget https://storage.googleapis.com/openimages/2017_07/oidv2-resnet_v1_101.ckpt.tar.gz
$ tar -xvf oidv2-resnet_v1_101.ckpt.tar.gz

  1. Extract tf model files:
    python -m mmdnn.conversion.examples.tensorflow.extract_model -n resnet_v1_101 -ckpt oidv2-resnet_v1_101.ckpt.data-00000-of-00001

However, I got a long error like this:

... DataLossError (see above for traceback): Unable to open table file ./oidv2-resnet_v1_101.ckpt.data-00000-of-00001: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
	 [[Node: save/RestoreV2 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2/tensor_names, save/RestoreV2/shape_and_slices)]]

I used the TF 1.4.1 and PyTorch 0.3.
Would you please help me to address this issue and do the conversion?

@kitstar
Copy link
Contributor

kitstar commented Dec 24, 2017

Hi, the extract_model.py of tf is an example code to show how to generate the full checkpoint files. You should modify your own inference code to generate your own checkpoint files.

@kitstar kitstar closed this as completed Jan 1, 2018
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