Tensorflow Colab ImportError:无法导入名称';挤压或展开尺寸';
在本教程之后,将执行第一步Tensorflow Colab ImportError:无法导入名称';挤压或展开尺寸';,tensorflow,google-colaboratory,Tensorflow,Google Colaboratory,在本教程之后,将执行第一步 !pip install -q -U "tensorflow-gpu=2.0.0b1" 设置: import os import matplotlib.pylab as plt import numpy as np import tensorflow as tf import tensorflow_hub as hub print("Version: ", tf.__version__) print("Eager mode: ", tf.executing_e
!pip install -q -U "tensorflow-gpu=2.0.0b1"
设置:
import os
import matplotlib.pylab as plt
import numpy as np
import tensorflow as tf
import tensorflow_hub as hub
print("Version: ", tf.__version__)
print("Eager mode: ", tf.executing_eagerly())
print("Hub version: ", hub.__version__)
print("GPU is", "available" if tf.test.is_gpu_available() else "NOT AVAILABLE")
出现错误:ImportError:无法导入名称“导出保存的模型”
我试过之后
%tensorflow_version 2.x
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
根据,出现了另一个错误:
导入错误:无法导入名称“挤压维度”或“展开维度”
还有,我试过!pip安装--升级tensorflow,出现另一个错误…ImportError:无法导入名称“collections\u abc”
我被困在这里 不要运行!pip安装-q-U“tensorflow gpu==2.0.0b1”
在“运行时”菜单下,将“运行时类型”更改为“GPU”和“工厂重置运行时”
导入操作系统
将matplotlib.pylab作为plt导入
将numpy作为np导入
导入tensorflow作为tf
将tensorflow_hub导入为hub
打印(“版本:,tf.\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu
打印(“急切模式:”,tf.executing_急切地()
打印(“中心版本:”,中心版本)
打印(“如果tf.test.is\GPU\u available()则GPU为”,“可用”)否则“不可用”)
输出:
Version: 2.2.0
Eager mode: True
Hub version: 0.8.0
GPU is available
@杰夫·斯奈德我的名声无法评论你的回答,你能帮我吗!thx很多人只是不知道为什么要运行教程(来自udacity),我很高兴我能提供帮助。