多平台统一管理软件接口,如何实现多平台统一管理软件接口
479
2022-08-29
【Python】Tensorflow-cpu-2.5.0运行Hello Tensorflow出错解决(tensorflow1.5支持python3.6)
问题及解决方法
1、AttributeError: module ‘tensorflow’ has no attribute 解决办法:
>>> tf.compat.v1.disable_eager_execution()>>> sess = tf.compat.v1.Session()
2、RuntimeError: The Session graph is empty. 解决办法:调整变量定义顺序。
>>> hello=tf.constant("Hello Tensorflow")>>> sess = tf.compat.v1.Session()>>> sess.run(hello)b'Hello Tensorflow'
操作实录
F:\tensorflow-2.4.0>env\Scripts\activate(env) F:\tensorflow-2.4.0>pythonPython 3.7.4 (default, Aug 9 2019, 18:34:13) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32Warning:This Python interpreter is in a conda environment, but the environment hasnot been activated. Libraries may fail to load. To activate this environmentplease see "help", "copyright", "credits" or "license" for more information.>>> import tensorflow as tf>>> hello=tf.constant("Hello Tensorflow")2021-08-10 09:36:26.404274: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVXTo enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.##问题1:版本2.5.0没有Session属性>>> sess=tf.Session()Traceback (most recent call last): File "
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~