Caffe: AttributeError: "can't set attribute"

Created on 21 Mar 2018  路  1Comment  路  Source: BVLC/caffe

Issue summary

Try to fill the filter weights and bias into the Layer.Convolution in pycaffe.
net.params['convres'][0].data= data2
net.params['convres'][0].data points to the filter weights correctly. But it triggers the assertion
when assign data to it.
Is there any solid way to fill the filter weights and bias into Convolution function in python?
I try to design a 3d convolution and needs to debug it step by step with the known filter weights.

Steps to reproduce

If you are having difficulty building Caffe or training a model, please ask the caffe-users mailing list. If you are reporting a build error that seems to be due to a bug in Caffe, please attach your build configuration (either Makefile.config or CMakeCache.txt) and the output of the make (or cmake) command.

Your system configuration

Operating system: ubuntu16 (x64)
Compiler: g++
CUDA version (if applicable): cuda8
CUDNN version (if applicable):cudnn7
BLAS:
Python or MATLAB version (for pycaffe and matcaffe respectively):python27

question

Most helpful comment

You want to do

net.params['convres'][0].data[...] = data2

to actually _copy_ the content of data2 into the param.

>All comments

You want to do

net.params['convres'][0].data[...] = data2

to actually _copy_ the content of data2 into the param.

Was this page helpful?
0 / 5 - 0 ratings