Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

报错 'Model' object has no attribute 'add_metric' #26

Open
dengchubo opened this issue Dec 2, 2019 · 2 comments
Open

报错 'Model' object has no attribute 'add_metric' #26

dengchubo opened this issue Dec 2, 2019 · 2 comments

Comments

@dengchubo
Copy link

File "D:\pythonfile\keras-faster-rcnn-master\keras-faster-rcnn-master\faster_rcnn\utils\model_utils.py", line 79, in compile
keras_model.add_metric(loss, aggregation='mean', name=name)
AttributeError: 'Model' object has no attribute 'add_metric'

@yizt
Copy link
Owner

yizt commented Dec 2, 2019

@dengchubo 我用的是TensorFlow 1.14.0

@dengchubo
Copy link
Author

谢谢大神回复,我现在一直在下这个版本还没下下来。运行你的程序的时候出现了好几处错误,我只是尝试用家里的电脑运行你这个程序,只有一块GPU。

  1. 开始报错tensorflow.python找不到python这个attribute, 然后把所有import tensorflow.python.keras as keras改成import keras才行,不知道是不是tf版本的问题
  2. 开始main里边的set_gpu_growth()那里报错,后来把那行注释掉gpu的错误就不出现了
    3.第二在Config里改两个地方的resnet50的权重路径,你说明里只写了一处
    4.就是我刚才说的那处问题,我看到在model_utils这个py里最后有一个add_metrics函数,不知道跟这个错误有没有关系

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants