Closed monajalal closed 7 years ago
Your generator threw an exception:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/engine/training.py", line 429, in data_generator_task
generator_output = next(self._generator)
File "/home/mona/computer_vision/VPilot/model.py", line 61, in dataGenerator
x[batchCount, frameIndex, :, :, :] = cv2.imread(frameFile, mode).astype('float32')
AttributeError: 'NoneType' object has no attribute 'astype'
cv2.imread()
returned None, meaning, I guess, that it couldn't open the file that was specified.
If your issue is an implementation question, please ask your question on StackOverflow or join the Keras Slack channel and ask there instead of filing a GitHub issue.
Traceback (most recent call last):
File "model.py", line 163, in
can someone help me how to solve this error
Your generator yielded None, or nothing. It could be caused either by the generator not being in a loop and running out of data to yield, or the generator itself might cause an Exception which would give this error.
Sent from my Verizon, Samsung Galaxy smartphone -------- Original message --------From: shyam1992atri notifications@github.com Date: 6/26/17 10:54 AM (GMT-08:00) To: fchollet/keras keras@noreply.github.com Cc: Pat York pat.york@nevada.unr.edu, Comment comment@noreply.github.com Subject: Re: [fchollet/keras] ValueError: output of generator should be a tuple (x, y, sample_weight) or (x, y). Found: None (#5196) can someone help me how to solve this error
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/fchollet/keras","title":"fchollet/keras","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/fchollet/keras"}},"updates":{"snippets":[{"icon":"PERSON","message":"@shyam1992atri in #5196: can someone help me how to solve this error\r\n"}],"action":{"name":"View Issue","url":"https://github.com/fchollet/keras/issues/5196#issuecomment-311133455"}}}
Thank you for your reply. I got it fixed from here https://github.com/llSourcell/How_to_simulate_a_self_driving_car/issues/7
My fix was making sure batch size was int, not float when passing to flow from directory.
I got the same error and traceback as follow:
Traceback (most recent call last):
File "c:\Users\asojasingarayar.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py", line 45, in
Model train script is available here
I solve this problem. I think that 'segmentation_models' is implemented using 'keras' not 'tf.keras'.
Error version(for using segmentation models)
import tensorflow Class Datagenerator('tf.keras.utils.Sequence')
Revised Version
import keras class Datagenerator('keras.utils.Sequence')
and it worked. I hope you guys get help. thanks
validation_data
should be a tuple (val_x, val_y, val_sample_weight)
or `(val_x, val_y)
@sunshower76 where would one make the edit you specified about tf.kera vs. keras? Specifically what .py file? Thank you.
Please suggest how to fix this?
code is: https://github.com/ai-tor/VPilot/blob/master/train.py