fizyr / keras-retinanet

Keras implementation of RetinaNet object detection.
Apache License 2.0
4.38k stars 1.96k forks source link

AttributeError: module 'tensorflow._api.v2.summary' has no attribute 'scalar' #1514

Closed sindhura234 closed 3 years ago

sindhura234 commented 3 years ago

I am training on my custom dataset. I followed the documentation and was able to perform training successfully for about 25 epochs. I have seen no issues so far. But then i realised that i have not given the option to perform validation. So I used the following arguments python keras_retinanet/bin/train.py --imagenet-weights --batch-size 4 --gpu 2,3 --epochs 25 --steps 3000 --snapshot-path snapshots/ --tensorboard-dir tensorboard_dir/ --no-resize --weighted-average --compute-val-loss csv ../Train.csv ../class_mapping.csv --val-annotations ../Val.csv After one epoch at the end, I get the following error. Please let me know how to fix it. Is it because of the different TF versions?

File "keras_retinanet/bin/../../keras_retinanet/callbacks/common.py", line 31, in on_epoch_end self.callback.on_epoch_end(epoch, logs=logs) File "keras_retinanet/bin/../../keras_retinanet/callbacks/eval.py", line 90, in on_epoch_end tf.summary.scalar("mAP", self.mean_ap, step=epoch) AttributeError: module 'tensorflow._api.v2.summary' has no attribute 'scalar'

I used tensorflow-gpu==2.3.0 keras==2.4.0

stale[bot] commented 3 years ago

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

huberemanuel commented 3 years ago

@sindhura234 any update on this?

I am facing the same issue with tensorflow/models project

stale[bot] commented 3 years ago

This issue has been automatically marked as stale due to the lack of recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

demongolem-biz commented 3 years ago

I have the same error. The thing to note is that on one computer this error arises but when I move to another computer it runs successfully. I have yet to figure out any difference in environments that would cause this, but I need to resolve tensorflow._api.v2.summary has no attribute scalar

Ben-Epstein commented 3 years ago

for me at least, i needed to have tensorboard installed. I am not sure why though pip install tensorboard

TruscaPetre commented 3 years ago

for me at least, i needed to have tensorboard installed. I am not sure why though pip install tensorboard

THANK YOU SIR!

Anil0205 commented 2 years ago

module 'tensorflow.compat.v2' has no attribute 'internal' Iam getting this error please help to sort out