rykov8 / ssd_keras

Port of Single Shot MultiBox Detector to Keras
MIT License
1.1k stars 553 forks source link

Value error. Please suggest what must be done now ? #61

Open ShivaliGoel opened 7 years ago

ShivaliGoel commented 7 years ago

/usr/local/lib/python2.7/site-packages/tensorflow/python/ops/gradients_impl.py:91: UserWarning: Converting sparse IndexedSlices to a dense Tensor of unknown shape. This may consume a large amount of memory. "Converting sparse IndexedSlices to a dense Tensor of unknown shape. " Exception in thread Thread-4: Traceback (most recent call last): File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 801, in bootstrap_inner self.run() File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 754, in run self.target(*self.args, **self.kwargs) File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 429, in data_generator_task generator_output = next(self._generator) File "", line 144, in generate img = imread(img_path).astype('float32') File "/usr/local/lib/python2.7/site-packages/scipy/misc/pilutil.py", line 154, in imread im = Image.open(name) File "/usr/local/lib/python2.7/site-packages/PIL/Image.py", line 2312, in open fp = builtins.open(filename, "rb") IOError: [Errno 2] No such file or directory: u'../../frames/frame01059.png'

Epoch 1/30

ValueError Traceback (most recent call last)

in () 5 validation_data=gen.generate(False), 6 nb_val_samples=gen.val_batches, ----> 7 nb_worker=1) /usr/local/lib/python2.7/site-packages/keras/engine/training.pyc in fit_generator(self, generator, samples_per_epoch, nb_epoch, verbose, callbacks, validation_data, nb_val_samples, class_weight, max_q_size, nb_worker, pickle_safe, initial_epoch) 1530 '(x, y, sample_weight) ' 1531 'or (x, y). Found: ' + -> 1532 str(generator_output)) 1533 if len(generator_output) == 2: 1534 x, y = generator_output ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None
nickyi1990 commented 7 years ago

@rykov8 Could you list the correct format of input files?

munsanje commented 7 years ago

IOError: [Errno 2] No such file or directory: u'../../frames/frame01059.png' You don't have this file on your machine, so the generator fails to produce a sample. Change all the paths in your code to match files you have.

Ryo-Kawanami commented 4 years ago

IOError: [Errno 2] No such file or directory: u'../../frames/frame01059.png' You don't have this file on your machine, so the generator fails to produce a sample. Change all the paths in your code to match files you have.

If you are using training data and validation data as a separate file, you must create, "validation_data" as a pickle, "val_path" and add to "gen" instance. I think you must have a prefix path only for the training data.