在服务器上搭建tensorflow Object Detection API环境时,因为是在实验室的服务器上添加了一个使用账号,所以没有root权限,不能使用sudo命令(前提)。实验室的cuda版本是8.0的,我查看了版本对应关系
cuda-8.0最高支持tensorflow-1.4.0版本,Object Detection API最低要求也是1.4.0版本,当时还很庆幸。
按照网上的方法一步步搭建,最后能运行 import tensorflow as tf了
坑来了,在运行python object_detection/builders/model_builder_test.py 时,报错:File "/home/yjzmatch/models-master/research/object_detection/predictors/heads/head.py", line 64, in <module>
class KerasHead(tf.keras.Model):
AttributeError: module 'tensorflow.python.keras' has no attribute 'Model'
如果是自己的电脑,更新cuda版本和tensorflow版本就好了,但是在没有root权限的服务器上,这是不行的,搜到的另一个解决办法是: