sunshineatnoon/Darknet.keras

doesn't work

Closed this issue · 10 comments

ssaru commented

return empty list from np.fromfile at TinyYoloNet.py, ReadTinyYOLONetWeights. line 76

how to fix it?

screenshot from 2017-06-22 22-06-18

Maybe #5 can help you. This repo based on the old YOLO weight, now YOLO has updated to 2.0. So you might need the old weight here.

ssaru commented

it's look like read weights file!

but... i getting another error!

Traceback (most recent call last):
File "RunTinyYOLO.py", line 209, in
model = SimpleNet(yoloNet)
File "RunTinyYOLO.py", line 38, in SimpleNet
model.add(Convolution2D(16, 3, 3, weights=[yoloNet.layers[1].weights,yoloNet.layers[1].biases],border_mode='valid',subsample=(1,1)))
File "/home/martin/Documents/enumnet/goverment_project/Deeplearning/Study/keras-darknet/env/lib/python3.5/site-packages/keras/models.py", line 476, in add
output_tensor = layer(self.outputs[0])
File "/home/martin/Documents/enumnet/goverment_project/Deeplearning/Study/keras-darknet/env/lib/python3.5/site-packages/keras/engine/topology.py", line 576, in call
self.set_weights(self._initial_weights)
File "/home/martin/Documents/enumnet/goverment_project/Deeplearning/Study/keras-darknet/env/lib/python3.5/site-packages/keras/engine/topology.py", line 1190, in set_weights
'provided weight shape ' + str(w.shape))
ValueError: Layer weight shape (3, 3, 448, 16) not compatible with provided weight shape (16, 3, 3, 3)

screenshot from 2017-06-23 11-09-01

Hi, I tried with the old weight but still getting error

abdulrahman@abdulrahman-ThinkPad-X230-Tablet:~/Darknet.keras$ python RunTinyYOLO.py
Traceback (most recent call last):
File "RunTinyYOLO.py", line 6, in
from utils.crop import crop
File "/home/abdulrahman/Darknet.keras/utils/crop.py", line 3, in
from scipy import misc
ImportError: No module named scipy

ssaru commented

@Abduoit
I think that you should install scipy module

pip install scipy
Or
pip3 install scipy

Thx @ssaru
I did
Now I get the following error

abdulrahman@abdulrahman-ThinkPad-X230-Tablet:~/Darknet.keras$ python RunTinyYOLO.py
Traceback (most recent call last):
File "RunTinyYOLO.py", line 8, in
from keras.models import Sequential
ImportError: No module named keras.models

ssaru commented

You installed keras? With tensorflow

  1. You should install tensorflow
    And after
    pip install keras

@ssaru
I do have tensorflow and keras and theano
now I am getting the following error

abdulrahman@abdulrahman-ThinkPad-X230-Tablet:~/Darknet.keras$ python RunTinyYOLO.py
Using TensorFlow backend.
RunTinyYOLO.py:38: UserWarning: Update your Conv2D call to the Keras 2 API: Conv2D(16, (3, 3), padding="valid", strides=(1, 1), weights=[array([[[...)
model.add(Convolution2D(16, 3, 3, weights=[yoloNet.layers[1].weights,yoloNet.layers[1].biases],border_mode='valid',subsample=(1,1)))
Traceback (most recent call last):
File "RunTinyYOLO.py", line 209, in
model = SimpleNet(yoloNet)
File "RunTinyYOLO.py", line 38, in SimpleNet
model.add(Convolution2D(16, 3, 3, weights=[yoloNet.layers[1].weights,yoloNet.layers[1].biases],border_mode='valid',subsample=(1,1)))
File "/usr/local/lib/python2.7/dist-packages/keras/models.py", line 469, in add
output_tensor = layer(self.outputs[0])
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 576, in call
self.set_weights(self._initial_weights)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/topology.py", line 1190, in set_weights
'provided weight shape ' + str(w.shape))
ValueError: Layer weight shape (3, 3, 448, 16) not compatible with provided weight shape (16, 3, 3, 3)

ssaru commented

Yes good!
Now you got error messagr that same with me
Im waiting author's answer :)

@ssaru I don't have access to a machine with GPU, so probably will not fix this bug. You might want to try other YOLO implementations: Tensorflow Version or Pytorch Version(YOLO2)

ssaru commented

Ok! i will try!
thanks :) !!