ansue-home
Day01——tensorflow-hello代码书写 视频代码: tensorflow—— import tensorflow as tf hello = tf.constant(\'hello tf!\') sess = tf.Session() print(sess.run(hello)) 问题: 1、目前tensorflow版本为v2,原视频版本为v1,因此需将第一行代码改为import tensorflow.compat.v1 as tf; 2、若改换版本后其他不变会出现The Session graph is empty. Add operations to the graph before calling run(),需在import后加入tf.disable_eager_execution(),原理未知 更新——定义init:init = tf.global_variables_initializer() sess.run(init) print(sess.run(hello)) 即可 opencv—— import cv2 img = cv2.imread(\'image0.jpg\',1)#图片的读取 1 彩色,0 灰度 cv2.imshow(\'image\',img)#窗体的名称|当前图片的内容 cv2.waitKey(0)#暂停

分类:

技术点:

相关文章:

  • 2019-07-08
  • 2021-10-18
  • 2021-12-14
  • 2021-12-15
  • 2021-12-21
  • 2021-12-13
  • 2021-12-03
猜你喜欢
  • 2021-09-25
  • 2021-11-14
  • 2021-11-17
  • 2021-12-17
  • 2021-10-01
  • 2021-10-24
  • 2021-11-02
相关资源
相似解决方案