Open xiaofengqing opened 7 years ago
I have also meet this error and I could not solve it yet ! Need help also!
@xiaofengqing Comment out this code: # if K.backend() == 'tensorflow':
# callbacks.append(tensorboard)
Then it can run.
Change histogram_freq=10 to histogram_freq=0 you can still use tensor board with this fix rather than removing it all together.
It is general issue with keras/tboard that you cannot get histograms with a validation_generator, changing histogram_freq=0 stops it trying to produce them.
@zwlshine I tried following lines and did not work for me. if K.backend() == 'tensorflow': tensorboard = TensorBoard(log_dir=os.path.join(save_path, 'logs'), histogram_freq=10, write_graph=True) callbacks.append(tensorboard)
@IsaacIsOkay When I turned histogram_freq to zero, it worked.
How is turning histogram_freq to zero a fix?! I need those histograms.
@mueller91 you can pass validation data separately to generate the histograms I think in a separate step, but yeah it isn't whats needed really.
@mueller91 I am not sure if you still have this issue, but this issue https://github.com/keras-team/keras/issues/3358 and the suggested solution by juiceboxjoe helped me.
Change histogram_freq=10 to histogram_freq=0 you can still use tensor board with this fix rather than removing it all together.
the original callbacks.py is with histogram_freq=0, but i still have ValueError: If printing histograms, validation_data must be provided, and cannot be a generator.
Is there a method from a validation generator, that would just spit out a bunch of them to test with?
something along the line of get_validation(validation_generator)
that would return what we need to add there?
It is general issue with keras/tboard that you cannot get histograms with a validation_generator, changing histogram_freq=0 stops it trying to produce them.
What's the issue? Why it is not possible when the validation set is a generator?
After i trained the first epoch,i meet this error File "/home/s405/pengcheng/project/Keras-FCN/train.py", line 232, in
label_suffix=label_suffix, ignore_label=ignore_label, label_cval=label_cval)
File "/home/s405/pengcheng/project/Keras-FCN/train.py", line 164, in train
class_weight=class_weight
File "/usr/local/lib/python3.4/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.4/dist-packages/keras/engine/training.py", line 2082, in fit_generator
callbacks.on_epoch_end(epoch, epoch_logs)
File "/usr/local/lib/python3.4/dist-packages/keras/callbacks.py", line 77, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/usr/local/lib/python3.4/dist-packages/keras/callbacks.py", line 751, in on_epoch_end
raise ValueError('If printing histograms, validation_data must be '
ValueError: If printing histograms, validation_data must be provided, and cannot be a generator.
I don't know how to fix this problem, can you give me some suggestions?