8688

net surgery on a custom caffe model

Question:

I'm trying to modify the weights of a caffemodel which is part of a caffe-branch called Deep Lab. Although there is a tutorial on <a href="http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/net_surgery.ipynb" rel="nofollow">how to do net surgery</a>, when I try to do the same with my custom caffemodel the python kernel dies always on the following line:

# Load the original network and extract the fully connected layers' parameters. net = caffe.Net('../models/deeplab/train.prototxt', '../models/deeplab/train.caffemodel', caffe.TRAIN)

I think its because pycaffe doesn't know their custom layers such as ImageSegData, Silence and SegAccuracy so I removed these layers from the prototxt file, but still the python kernel keeps on dying when I try to load the network model. Does anyone know how to load these weights into python?

Answer1:

I found it already. I had literally to remove every custom layer and especially adapt the data layer such that it could read all the input images and thereby calculate the input dimensions.

Recommend

  • Controlling lives of turtles in NetLogo
  • SKSpriteKit, detect non-transparency parts
  • SGDClassifier kernel dies when using scikit
  • 'SOCK_RAW' option in 'socket' system call
  • Regex is not working as expected?
  • Running exec() command with dev>null & doesn't work, but dev>null does
  • use rvest and css selector to extract table from scraped search results
  • Mocking Non-Standard Events in F# Foq
  • Configuring Ninject
  • How to load Q library with Require.js?
  • How do I change the kernel/python version for iPython?
  • Receiver has no segue with identifier“***”
  • triggering user space with kernel
  • New Firebase failed: First argument must be a valid firebase URL and the path can't contain “.”
  • import scipy.sparse failed
  • Private IP address in reserved subnet range
  • Who propagate bugfixes across branches (corporate development)?
  • During installation of Django, why do I keep getting ImportError: No module named django?
  • where do I find the xml.dom python package for the python-2.6.0-8.9.28 and I have a suse/x86_64 vers
  • Python pickle not one-to-one: different pickles give same object
  • xcode don't localize specific strings
  • C# program and C++ DLL compiled for 32-bit system crash on 64-bit system
  • Loading .coffee files via a view in Rails
  • Create DicomImage from scratch using Dcmtk
  • Avoid links criss cross / overlap in d3.js using force layout
  • Recording logins for password protected directories
  • ilmerge with a PFX file
  • Update CALayer sublayers immediately
  • Using $this when not in object context
  • NetLogo BehaviorSpace - Measure runs using reporters
  • Spring security and special characters
  • How do I fake an specific browser client when using Java's Net library?
  • How reduce the height of an mschart by breaking up the y-axis
  • script to move all files from one location to another location
  • Perl system calls when running as another user using sudo
  • JSON with duplicate key names losing information when parsed
  • Error creating VM instance in Google Compute Engine
  • C# - Getting references of reference
  • Running Map reduces the dimensions of the matrices
  • How to load view controller without button in storyboard?