Comments (7)
any update on this one?
from mmdnn.
Any update?
from mmdnn.
Any update on this?
from mmdnn.
any update on this :)
from mmdnn.
Slice layer of Caffe parser is not implemented. We will inform you asap. Thanks.
from mmdnn.
any update on this :)
from mmdnn.
I have an immature solution in caffe to tensorflow:
in mmdnn/conversion/caffe/shape.py
add code:
def shape_slice(node):
print(node.parameters)
axis = node.parameters.axis
slices = len(node.parameters.slice_point) if len(node.parameters.slice_point) > 2 else 2
input_shape = node.get_only_parent()[0].output_shape
if axis == 1:
return TensorShape(input_shape.batch_size, input_shape.channels // slices, input_shape.height, input_shape.width)
elif axis == 2:
return TensorShape(input_shape.batch_size, input_shape.channels, input_shape.height // slices, input_shape.width)
elif axis == 3:
return TensorShape(input_shape.batch_size, input_shape.channels, input_shape.height, input_shape.width // slices)
return TensorShape(input_shape.batch_size, input_shape.channels // slices, input_shape.height, input_shape.width)
in mmdnn/conversion/caffe/graph.py
modify code:
...
'Split': shape_split,
'Slice': shape_slice,
'TanH': shape_identity,
...
in mmdnn/conversion/caffe/mapper.py
add code in class NodeMapper:
@classmethod
def map_slice(cls, node):
slices = len(node.parameters.slice_point) if len(node.parameters.slice_point) > 2 else 2
kwargs = {'axis': (2, 3, 1, 0)[node.parameters.axis], 'num_or_size_splits': slices}
cls._convert_output_shape(kwargs, node)
return Node.create('Split', **kwargs)
so you can run command:
mmtoir -f caffe -n ./models/model.prototxt -w ./models/model.caffemodel -o caffe_model_IR
mmtocode -f tensorflow --IRModelPath caffe_model_IR.pb --IRWeightPath caffe_model_IR.npy --dstModelPath tf_model_IR.py
It generates tensorflow model code: tf_model_IR.py
Now you can modify tf_model_IR.py
source file to correspond to caffe model
Note:
This can only divide input tensor evenly.
from mmdnn.
Related Issues (20)
- Handling multiple inputs in keras
- load higher version pytorch model error
- AttributeError: 'NoneType' object has no attribute 'name' in FusedBatchNorm HOT 3
- KeyError while converting PyTorch model to IR
- How to make modifications?
- Make upgrades?
- Fail to convert resnet101 from PyTorch to IR
- Convert Inception_v3 from Caffe to PyTorch
- SpaceToBatchND/BatchToSpaceND not supported while converting from tensorflow to caffe
- Fail to Convert resnet from Caffe to onnx and Pytorch
- mmtoir from PyTorch 2 IR missing .json, .npy and .pb file
- Getting ValueError: axes don't match array
- Pytorch model GFPGANv1.3.pth
- onnx2IR? HOT 1
- This repo is missing important files HOT 2
- How can I convert tf(.pb) to pytorch?
- Error to convert a model from IR to Pytorch
- Error converting caffe to torch model HOT 1
- pytorch to onnx
- pytorch to onnx
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 mmdnn.