Comments (3)
You can try it.
If it only has "classical" layers like Conv, RELU, Pooling, etc. then it should work without a problem.
from keras.
I'm currently trying to convert squeeze net and I get the following error
Alias-MacBook-Air:caffe Alia$ python caffe2keras.py -load_path '/Users/Alia/Documents/Spring 2017/Thesis/converting/' -prototxt 'converter.prototxt' -caffemodel 'squeezenet_v1.1.caffemodel'
Using TensorFlow backend.
Converting model...
CREATING MODEL
Traceback (most recent call last):
File "caffe2keras.py", line 45, in
main(args)
File "caffe2keras.py", line 34, in main
model = convert.caffe_to_keras(args.load_path+'/'+args.prototxt, args.load_path+'/'+args.caffemodel, debug=args.debug)
File "/Users/Alia/Desktop/converter/keras/keras/caffe/convert.py", line 43, in caffe_to_keras
debug)
File "/Users/Alia/Desktop/converter/keras/keras/caffe/convert.py", line 259, in create_model
net_node[layer_nb] = Activation('softmax', name=name)(input_layers)
File "/Users/Alia/Desktop/converter/keras/keras/engine/topology.py", line 569, in call
self.add_inbound_node(inbound_layers, node_indices, tensor_indices)
File "/Users/Alia/Desktop/converter/keras/keras/engine/topology.py", line 632, in add_inbound_node
Node.create_node(self, inbound_layers, node_indices, tensor_indices)
File "/Users/Alia/Desktop/converter/keras/keras/engine/topology.py", line 164, in create_node
output_tensors = to_list(outbound_layer.call(input_tensors[0], mask=input_masks[0]))
File "/Users/Alia/Desktop/converter/keras/keras/layers/core.py", line 250, in call
return self.activation(x)
File "/Users/Alia/Desktop/converter/keras/keras/activations.py", line 17, in softmax
'Here, ndim=' + str(ndim))
ValueError: Cannot apply softmax to a tensor that is not 2D or 3D. Here, ndim=4
Any advice or insight?
from keras.
Hi Alia,
The softmax layer in keras expects a tensor with the shape (batch_size, num_classes) however, the output from pool10 layer in case of squeezenet is (batch_size, num_filters, height, width). I recently submitted a PR that handles this, basically, it reshapes a 4-dim output to a 2-dim one.
from keras.
Related Issues (20)
- Recurrent dropout is broken in (at least) AttGRUCond HOT 1
- Deconvolution layer not supported, while converting caffemodel weight into keras. HOT 3
- If i'm intending on using tensor flow? HOT 3
- Test WeightNorm optimizers HOT 1
- Use non-standard version of caffe for model conversion. HOT 3
- Bug when run caffe2keras HOT 1
- Hi
- hi when i run test_segmentation.py i receive this error str(n) + ' integers. Received: ' + str(value)) ValueError: The `1st entry of padding` argument must be a tuple of 2 integers. Received: 100
- when i run test_segmentation.py i receive this essor str(n) + ' integers. Received: ' + str(value)) ValueError: The `1st entry of padding` argument must be a tuple of 2 integers. Received: 100
- Conversion of PoolingND Layer
- python3 support for caffe2keras HOT 1
- Error when converting with merge layer
- the accuracy decrease appearently after converting caffe to keras. HOT 1
- Error when converting with Scale layer HOT 1
- TypeError: __call__() takes 2 positional arguments but 4 were given HOT 4
- no module named 'keras_applications' HOT 1
- TypeError: expected bytes, str found HOT 4
- Negative dimension size for 'pool2/MaxPool' (op: 'MaxPool') with input shapes:[?,1,112,128].
- Hi, I'm just wondering why you coded like this.
- Caffe2keras.py: ValueError: need more than 3 values to unpack in convert.py
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras.