【发布时间】:2019-07-13 16:16:55
【问题描述】:
我在尝试测试对象检测api model_builder_test.py时遇到以下错误。
!apt-get install -y -qq protobuf-compiler python-pil python-lxml
!git clone --quiet https://github.com/tensorflow/models.git
import os
os.chdir('models/research')
!protoc object_detection/protos/*.proto --python_out=.
import sys
sys.path.append('/content/models/research/slim')
%run object_detection/builders/model_builder_test.py
运行model_builder_test.py后出现如下错误
.W0220 03:22:35.097244 140099951081344 deprecation.py:323] 来自 /content/models/research/object_detection/anchor_generators/grid_anchor_generator.py:59: to_float(来自 tensorflow.python.ops.math_ops)已被弃用,并将 在未来的版本中被删除。更新说明:使用 tf.cast 反而。 .. 警告:TensorFlow contrib 模块不会 包含在 TensorFlow 2.0 中。欲了解更多信息,请参阅:* https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md * https://github.com/tensorflow/addons 如果您依赖的功能未在此处列出,请提交问题。
........s -------------------------------------------------- -------------------- 在 0.203 秒内运行 22 次测试
确定(跳过=1) -------------------------------------------------- ------------------------- AttributeError Traceback(最近调用 最后)在() ----> 1 get_ipython().magic('run object_detection/builders/model_builder_test.py')
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py 在魔法(自我,arg_s)2158魔法名称,_,magic_arg_s = arg_s.partition('') 2159 魔法名称 = magic_name.lstrip(前置过滤器.ESC_MAGIC) -> 2160 返回 self.run_line_magic(magic_name, magic_arg_s) 2161 2162
---------------------------------------------- --------------------------
/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py 在 run_line_magic(self, magic_name, line) 2079
kwargs['local_ns'] = sys._getframe(stack_depth).f_locals 2080
使用 self.builtin_trap: -> 2081 结果 = fn(*args,**kwargs) 2082 返回结果 2083in run(self, parameter_s, runner, file_finder)
/usr/local/lib/python3.6/dist-packages/IPython/core/magic.py 在 (f, *a, **k) 186 # 但对于那一点状态来说就有点过分了。 第187章 --> 188 调用 = lambda f, *a, **k: f(*a, **k) 189 190 如果可调用(arg):
/usr/local/lib/python3.6/dist-packages/IPython/core/magics/execution.py 在运行中(self,parameter_s,runner,file_finder) 740 其他: 第741章 --> 742 运行() 743 第744章
/usr/local/lib/python3.6/dist-packages/IPython/core/magics/execution.py 在运行() 第726章 727亚军(文件名,prog_ns,prog_ns, --> 728 退出_忽略=退出_忽略) 729 730 if 't' in opts:
/usr/local/lib/python3.6/dist-packages/IPython/core/pylabtools.py 在 mpl_execfile(fname, *where, **kw) 175 matplotlib.interactive(is_interactive) 176 # 现在进行渲染调用,如果用户尝试这样做 --> 177 如果 plt.draw_if_interactive.call: 第178章 第179章
AttributeError:“函数”对象没有“调用”属性
【问题讨论】:
-
这个不是jupyter notebook自带的吗?
-
我在 colab 上使用 jupyter notebook...不确定您指的是什么“this”?
标签: python-3.x tensorflow matplotlib google-colaboratory object-detection-api