dfsljkjafdsk; 2022-04-30 09:21 采纳率: 100%
浏览 94
已结题

python运行报错,求解答

img


车牌识别代码,运行出错,啥问题
报错内容:
D:\python\python.exe "C:/Users/14643/Desktop/License Plate Recognition/CNN_NeuralNet.py"
2022-04-30 09:14:22.707771: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-04-30 09:14:22.707891: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "C:\Users\14643\Desktop\License Plate Recognition\CNN_NeuralNet.py", line 188, in
net = char_cnn_net()
File "C:\Users\14643\Desktop\License Plate Recognition\CNN_NeuralNet.py", line 24, in init
self.x_place = tf.placeholder(dtype=tf.float32, shape=[None, self.img_size, self.img_size], name='x_place')
AttributeError: module 'tensorflow' has no attribute 'placeholder'

进程已结束,退出代码1

  • 写回答

2条回答 默认 最新

  • 关注

    这个代码需要tensorflow 1.多的版本,你现在可能是版本太高了
    加上这个适配低版本

    import tensorflow.compat.v1 as tf
    tf.disable_v2_behavior()
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 5月8日
  • 已采纳回答 4月30日
  • 创建了问题 4月30日

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效