RuntimeError: cannot dereference null pointer from cdata 'float *


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 “”, 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/”, 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/”, 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/”, 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/”, 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/”, line 397, in _read_memory_buffer
data_np[i] = data[i]
RuntimeError: cannot dereference null pointer from cdata ‘float *’


This worked for me.


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.


@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 and compile the library and use it while running.


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