OverflowError: long int too large to convert to int

1,023 views
Skip to first unread message

sri

unread,
May 26, 2015, 2:15:56 PM5/26/15
to caffe...@googlegroups.com
Hi,

My caffe was working fine until couple of days ago. I wrote a new layer and compiled again. Now, when I'm trying to do net surgery, during the step net.params['layer_name'].data, I get an error that states

File "/home/caffe-master/python/caffe/pycaffe.py", line 39, in _Net_params 
if len(lr.blobs) > 0])
OverflowError: long int too large to convert to int,   
*** glibc detected *** /path/to/anaconda/python2.7: munmap_chunk(): invalid pointer: 0x0000000006cabb38 ***

and the program crashes. If I try to do forward prop alone, to make predictions, the code runs and once it is done, it still prints stuff related to glibc. 

I see that someone has already encountered the same problem and reported a bug here. They posted a work around for this issue. In their solution, he/she read net using google-protocol buffer in Python directly. For me, reading my net with the following lines of code:
net = caffe.proto.caffe_pb2.NetParameter()
net.ParseFromString(open(trainedNetwork.caffemodel).read())

reads the net, but I'm not sure how to use it to access/modify weights; net.layers returns an empty iterable.  Can anyone help me figure out how to solve the overflow issue ?

Thanks! 

Mengyue Geng

unread,
Jun 17, 2015, 4:17:04 AM6/17/15
to caffe...@googlegroups.com
I've encountered just the same problem, *make clean* and re-compile Caffe saved me. 
After checking my layer cpp file and caffe.proto, I didn't find anything wrong.
But I notice one thing that, on my machine, even if I add an optional parameter in my caffe.proto, without writing any new layer, the error still occurs. 
So the error is not the code but the way we compile it, at least it worked in my case, hope it can help:) 

在 2015年5月27日星期三 UTC+8上午2:15:56,sri写道:
Message has been deleted

eric-phu

unread,
Aug 13, 2015, 2:24:18 AM8/13/15
to Caffe Users
This solves my issue. Thanks!
Reply all
Reply to author
Forward
0 new messages