RuntimeError: cannot dereference null pointer from cdata 'float *


#1

I have tried running the darknet test from the test folder as well as the darknet tutorial but am getting the same error in both cases.

Executing the following lines:

dtype = ‘float32’
batch_size = 1
print(“Converting darknet to nnvm symbols…”)
sym, params = nnvm.frontend.darknet.from_darknet(net, dtype)

But the following error occurs

Loading weights from ./yolo.weights…Done!
Converting darknet to nnvm symbols…
Traceback (most recent call last):
File “from_darknet.py”, line 141, in
sym, params = nnvm.frontend.darknet.from_darknet(net, dtype)
File “/usr/local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/frontend/darknet.py”, line 643, in from_darknet
return _from_darknet(net, dtype)
File “/usr/local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/frontend/darknet.py”, line 617, in _from_darknet
_get_darknet_params(net.layers[i], layer_name, tvmparams, dtype)
File “/usr/local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/frontend/darknet.py”, line 566, in _get_darknet_params
_get_convolution_weights(layer, opname, tvmparams, dtype)
File “/usr/local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/frontend/darknet.py”, line 414, in _get_convolution_weights
biases = _read_memory_buffer((layer.n, ), layer.biases, dtype)
File “/usr/local/lib/python3.6/site-packages/nnvm-0.8.0-py3.6.egg/nnvm/frontend/darknet.py”, line 397, in _read_memory_buffer
data_np[i] = data[i]
RuntimeError: cannot dereference null pointer from cdata ‘float *’


#2

This worked for me.


#3

I tried installing the packages and changed the code but even after the changes, I get the same error. I tried compiling using the alexnet model and I get the same error in the same place.


#4

@Bryanscott13 we checked the issue, found that this issue will happen when you download from darknet master branch and compiled the library.
It wont happen if you download from https://github.com/siju-samuel/darknet and compile the library and use it while running.


#5

@PariksheetPinjari909 @Bryanscott13
What’s the difference from compiling with master branch?
Would you please share the changes made in siju-samuel darknet repo ?
Thanks!!