GithubHelp home page GithubHelp logo

pytorchtocaffe's People

Contributors

xxradon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pytorchtocaffe's Issues

FeatherNet

你好,我现在能将FeatherNet的pytorh模型生成caffemodel和prototxt,但是prototxt好像不对,前向的时候会报错。view2维度是16x1x1,但是add1的维度是16x56x56,这两个mul1 做运算的时候会报错
2019-09-18 10-19-29屏幕截图

FeatherNet 转 caffe

你好,我正好也要使用FeatherNet 的caffe模型, 我从FeatherNet作者那里下载了模型,他那里的图片输入是224x224,用你的工具尝试转化没有成功。我看到你的FeatherNet模型的输入是112x112,应该成功了吧,可以开源出来吗

Error with add/mul/Eltwise

import torch
from torchvision.models import resnet
import pytorch_to_caffe
from facenet_pytorch import InceptionResnetV1

if name=='main':
name='VGGFace2'
# For a model pretrained on VGGFace2
model = InceptionResnetV1(pretrained='vggface2').eval()

input=torch.ones([1, 3, 512, 512])

pytorch_to_caffe.trans_net(model, input, name)
pytorch_to_caffe.save_prototxt('{}.prototxt'.format(name))
pytorch_to_caffe.save_caffemodel('{}.caffemodel'.format(name))

Add blob conv_blob13 : torch.Size([1, 256, 61, 61])
140602027406272:cat_blob1 getting
140602027407552:conv_blob13 getting
mul1 was added to layers
140602027406752:mul_blob1 was added to blobs
Add blob mul_blob1 : torch.Size([1, 256, 61, 61])
140602027407552:conv_blob13 getting
Traceback (most recent call last):
File "VGGFace2_pytorch_2_caffe.py", line 14, in
pytorch_to_caffe.trans_net(model, input, name)
File "/home/songdc/Documents/PytorchToCaffe/pytorch_to_caffe.py", line 675, in trans_net
out = net.forward(input_var)
File "/home/songdc/miniconda3/lib/python3.7/site-packages/facenet_pytorch/models/inception_resnet_v1.py", line 288, in forward
x = self.repeat_1(x)
File "/home/songdc/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/songdc/miniconda3/lib/python3.7/site-packages/torch/nn/modules/container.py", line 92, in forward
input = module(input)
File "/home/songdc/miniconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 489, in call
result = self.forward(*input, **kwargs)
File "/home/songdc/miniconda3/lib/python3.7/site-packages/facenet_pytorch/models/inception_resnet_v1.py", line 65, in forward
out = out * self.scale + x
File "/home/songdc/Documents/PytorchToCaffe/pytorch_to_caffe.py", line 552, in _mul
bottom=[log.blobs(input), log.blobs(args[0])], top=top_blobs)
File "/home/songdc/Documents/PytorchToCaffe/pytorch_to_caffe.py", line 101, in blobs
print("{}:{} getting".format(var, self._blobs[var]))
File "/home/songdc/Documents/PytorchToCaffe/pytorch_to_caffe.py", line 39, in getitem
return self.data[key]
KeyError: 140602226322992

torch:1.0
torchvision:0.2
(haven add code torchvison.ops.boxes to facenet_pytorch source code which occur in torchvision>0.3)

Why does the error occur? Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.