Questions tagged [caffe2]

Caffe2 is an open-source deep learning framework, which is developed and maintained by Facebook, and is based on the Caffe framework.

Caffe2 is a deep learning framework, which is based on the framework. It is developed and maintained by Facebook, and released under the Apache 2.0 license, on GitHub.

Caffe2 is an improved / redesigned version of Caffe. A presentation by Caffe2's lead developer Yangqing Jia, held at CVPR 2015, shows some of the consideration of the redesign.

Useful links

116 questions
2
votes
0 answers

Slice a tensor in Caffe2

I write a model converter for keras to Caffe2. Unfortunately the strided convolution with padding='same' is implemented differently in Caffe2. Namely there is a shift of 1 pixel in x and y. How can I slice a tensor in Caffe2, to correct the offset?
arm
  • 605
  • 1
  • 7
  • 16
2
votes
0 answers

Caffe2's equivalent to Caffe's Net.backward()?

I am trying to obtain the gradient of the loss with respect to an input image. In Caffe (the original), the following code achieved my goal: ### Load image into net's data layer img = caffe.io.load_image(jpg_file) transformed_image =…
Mink
  • 857
  • 2
  • 11
  • 24
2
votes
0 answers

Caffe2 Flickr Model - What preprocessing is required for Image dataset

I am trying to run the Flickr style model in caffe2 But I couldn't get the preprocessing steps required for the dataset. Please guide me. Thanks in advance
Venki B
  • 21
  • 1
2
votes
0 answers

Caffe2 Import Throwing Error in Python free() invalid size

I'm trying to import the following modules for a Caffe2 tutorial. Tutorial here: https://github.com/caffe2/caffe2/blob/master/caffe2/python/tutorials/Loading_Pretrained_Models.ipynb Modules here: %matplotlib inline from caffe2.proto import…
Sky Walker
  • 23
  • 4
2
votes
1 answer

CMakeFiles/Makefile2:1429: recipe for target 'caffe2/CMakeFiles/conv_op_cache_cudnn_test.dir/all' failed

When I've installed all the prerequisites listed in the install page of caffe2, I type the command make && cd build && sudo make install the compile caffe2, then I got the following error, the 1st part is log file using…
zack.Zcy
  • 31
  • 1
  • 3
1
vote
1 answer

Compute cumsum in pycaffe

I'm currently trying to implement an equivalent of pytorch's cumsum function in Caffe2, ideally using the standard operators (not messing with the C++ code), and having some trouble. My best attempt so far is pred_cdist = net.Transpose( …
Isaac
  • 3,586
  • 1
  • 18
  • 20
1
vote
1 answer

How to ensure that a tensor is in dense representation in caffe2

I'm writing a loss-function in python Caffe2 that will receive a tensor, and (as the first step) compute the transpose of the input tensor: pred_t = net.Transpose(prediction) Because of the particular setup I am working with, I do not have full…
Isaac
  • 3,586
  • 1
  • 18
  • 20
1
vote
1 answer

caffe2 inference a onnx model , happend IndexError: Input 475 is undefined

Error: when I use caffe2 for pretraind model. the model is from https://github.com/onnx/models/blob/master/vision/classification/vgg/model/vgg16-7.onnx the model I use is pretrained model, I do not change the model, and not use…
wwbnjs
  • 21
  • 5
1
vote
1 answer

Issue when converting ONNX model to Caffe2

I converted a TF model to ONNX and then ONNX model to Caffe2. The conversion happened successfully. However, I am getting a RunTime Error when trying to load and infer from the obtained model. This is the error that I am receiving. How do I add the…
ranka47
  • 995
  • 8
  • 25
1
vote
1 answer

Operator translate error occurs when I try to convert onnx file to caffe2

I train a boject detection model on pytorch, and I have exported to onnx file. And I want to convert it to caffe2 model : import onnx import caffe2.python.onnx.backend as onnx_caffe2_backend # Load the ONNX ModelProto object. model is a standard…
1
vote
1 answer

When I converted a vgg model written by pytorch to caffe2, I encountered this problem

model = VGGish() # vgg model class model.train(False) x = torch.randn(10, 1, 64, 96, requires_grad=True) # Export the model torch_out = torch.onnx._export(model, # model being run`enter code here` x, …
ultraseven
  • 11
  • 1
1
vote
2 answers

Which is faster when deploying cnn models by TensorFlow Lite, Caffe2 or OpenCV?

We can deploy MobileNet on Smartphone by TensorFlow Lite, Caffe2 or OpenCV, and I think Caffe2 will provide the best performance with higher fps. But why? Is the performance gap between them so large? Thanks.
1
vote
2 answers

Installing pytorch fails - fatal error: libavutil/motion_vector.h: No such file or directory

I'm trying to install pytorch python setup.py install but it fails as it can't locate libavutil/motion_vector.h [ 66%] Building CXX object caffe2/CMakeFiles/torch.dir/video/video_input_op.cc.o In file included from…
Zahra
  • 6,798
  • 9
  • 51
  • 76
1
vote
0 answers

Can't install Caffe2 on Ubuntu 18.04

I am trying to install Facebook's Detectron and so I need to install Caffe2. I followed this instruction. Basically, I clone the PyTorch repo with git clone https://github.com/pytorch/pytorch.git && cd pytorch git submodule update --init…
Milos Milunovic
  • 422
  • 2
  • 5
  • 10
1
vote
0 answers

fatal error LNK1181: cannot open input file 'Project\pytorch\build\lib\caffe2_protos.lib'

I am trying to setup caffe2 without gpu in windows and I am getting the following error: I have tried installation from caffe2 page but that didn't work. So I have tried the steps from the pytorch's github…