caffe-tensorflow
caffe-tensorflow copied to clipboard
transfered model do not work normally on tensorflow 1.3
I have transfered a model from caffe 0.16. the Net is ResNet18.
the example of imagenet can run smoothly. but the output is incorrect, the output is always a fixed class with confidence 1 no matter what image feeded.
I have changed the code according to #128
I am facing the same problem. I am using tensorflow 1.2.1. I have opened an issue #144 . Were you able to resolve this?
maybe you can check your python,is it python3.x?if the answer is yes,the code is normal to make some problem.Because the environment of the author's code is python2.7. Maybe you can review my code based on the author's code https://github.com/GZHermit/caffe2tensorflow_python3.git If I do something wrong,please tell me.
Hi,
I am using Python version 2.7 and tensorflow 1.2
Hi,
I tried your @GZHermit code. It gives me this error in batch normalisation layer. I got the same error when I used the original (caffe-tensorflow) code also and I fixed it as below: variance *= scaling_factor.reshape(1)
I had to make few other changes also mostly for the batch normalisation layer to get the code working for me, not sure if my changes are the issue. Also, is there a specific data preprocessing that needs to be done to use the converted model? I noticed that caffe takes input as channel x width x height , while tensorflow takes as width x height x channel? Any inputs would be helpful!
WARNING: PyCaffe not found!
Falling back to a pure protocol buffer implementation.
* Conversions will be drastically slower.
* This backend is UNTESTED!
Converting data...
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
Warning: parmaters not reshaped for node: [BatchNorm] conv1_bn
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
Warning: parmaters not reshaped for node: [BatchNorm] conv2_bn
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
Warning: parmaters not reshaped for node: [BatchNorm] conv3_bn
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
('hehe:', <type 'list'>)
Traceback (most recent call last):
File "convert.py", line 60, in
@shresthamalik Try to install a caffe instead of the pure protobuf implementation.