- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我可以看到这个问题在这里之前已经被问过
tensorflow-has-no-attribute-compat
但给出的答案是
Microsoft Visual C++ 2015-2019 Redistributable (x64)
它对以前的成员不起作用,对我也不起作用。我安装了 Visual Studio 2019。无论如何,我还是下载了它并修复了(MV C++)以防万一。仍然得到同样的错误。
tensorflow-gpu 2.1
python 3.7.7
CUDA 10.1
Anaconda 3.7
看起来 gpu 启动成功。
2020-06-28 07:19:47.851257: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
3.7.7 的 python 包。
Package Version
---------------------- ----------------------------
absl-py 0.9.0
appdirs 1.4.4
astor 0.7.1
astroid 2.4.2
astropy 4.0.1.post1
attrs 19.3.0
backcall 0.2.0
bayesian-optimization 1.2.0
black 19.10b0
bleach 3.1.5
blinker 1.4
brotlipy 0.7.0
cachetools 4.1.0
certifi 2020.6.20
cffi 1.14.0
chardet 3.0.4
click 7.1.2
cloudpickle 1.3.0
colorama 0.4.3
confuse 1.3.0
cryptography 2.9.2
cycler 0.10.0
decorator 4.4.2
defusedxml 0.6.0
entrypoints 0.3
future 0.18.2
gast 0.2.2
gitdb 4.0.5
GitPython 3.1.3
google-auth 1.17.2
google-auth-oauthlib 0.4.1
google-pasta 0.2.0
grpcio 1.27.2
gym 0.17.2
h2o 3.30.0.5
h5py 2.10.0
htmlmin 0.1.12
idna 2.10
ImageHash 4.1.0
importlib-metadata 1.7.0
invoke 1.4.1
ipykernel 5.3.0
ipython 7.16.1
ipython-genutils 0.2.0
ipywidgets 7.5.1
isort 4.3.21
jedi 0.17.1
Jinja2 2.11.2
joblib 0.15.1
json5 0.9.5
jsonschema 3.2.0
jupyter 1.0.0
jupyter-client 6.1.3
jupyter-console 6.1.0
jupyter-core 4.6.3
jupyterlab 2.1.5
jupyterlab-server 1.1.5
kaggle 1.5.6
Keras 2.4.3
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
kiwisolver 1.2.0
lazy-object-proxy 1.4.3
lightgbm 2.3.1
llvmlite 0.33.0
Markdown 3.2.2
MarkupSafe 1.1.1
matplotlib 3.2.2
mccabe 0.6.1
missingno 0.4.2
mistune 0.8.4
mkl-service 2.3.0
nbconvert 5.6.1
nbdime 2.0.0
nbformat 5.0.7
networkx 2.4
notebook 6.0.3
numba 0.50.1
numpy 1.19.0
oauthlib 3.0.1
opt-einsum 0+untagged.56.g2664021.dirty
packaging 20.4
pandas 1.0.5
pandas-profiling 2.8.0
pandocfilters 1.4.2
parso 0.7.0
path 13.1.0
path.py 12.4.0
pathspec 0.8.0
patsy 0.5.1
phik 0.10.0
pickleshare 0.7.5
Pillow 7.1.2
pip 20.1.1
plotly 4.8.2
prometheus-client 0.8.0
prompt-toolkit 3.0.5
protobuf 3.12.3
py4j 0.10.9
pyasn1 0.4.8
pyasn1-modules 0.2.7
pycparser 2.20
pyglet 1.5.0
Pygments 2.6.1
PyJWT 1.7.1
pylint 2.5.3
pyOpenSSL 19.1.0
pyparsing 2.4.7
pyreadline 2.1
pyrsistent 0.16.0
PySocks 1.7.1
pyspark 3.0.0
python-dateutil 2.8.1
python-slugify 4.0.0
pytz 2020.1
PyWavelets 1.1.1
pywin32 228
pywinpty 0.5.7
PyYAML 5.3.1
pyzmq 19.0.1
qtconsole 4.7.5
QtPy 1.9.0
regex 2020.6.8
requests 2.24.0
requests-oauthlib 1.2.0
retrying 1.3.3
rsa 4.6
scikit-learn 0.23.1
scipy 1.5.0
seaborn 0.10.1
Send2Trash 1.5.0
setuptools 47.3.1.post20200616
six 1.15.0
smmap 3.0.4
statsmodels 0.11.1
tabulate 0.8.7
tangled-up-in-unicode 0.0.6
tensorboard 2.2.2
tensorboard-plugin-wit 1.6.0.post3
tensorflow 2.1.0
tensorflow-estimator 2.2.0
termcolor 1.1.0
terminado 0.8.3
testpath 0.4.4
text-unidecode 1.3
threadpoolctl 2.1.0
toml 0.10.1
tornado 6.0.4
tqdm 4.46.1
traitlets 4.3.3
typed-ast 1.4.1
urllib3 1.24.3
visions 0.4.4
wcwidth 0.2.5
webencodings 0.5.1
Werkzeug 0.16.1
wheel 0.34.2
widgetsnbextension 3.5.1
win-inet-pton 1.1.0
wincertstore 0.2
wrapt 1.12.1
zipp 3.1.0
这是我尝试导入 tensorflow 时遇到的错误。 (注意:我在 Tensorflow 2.1 的 GPU 安装和 CPU 安装中收到此错误)
Python 3.7.7 (default, May 6 2020, 11:45:54) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-07-05 09:48:26.577683: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudart64_101.dll
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow\__init__.py", line 101, in <module>
from tensorflow_core import *
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\__init__.py", line 46, in <module>
from . _api.v2 import compat
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
from . import v1
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
from . import compat
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 39, in <module>
from . import v1
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v1\__init__.py", line 29, in <module>
from tensorflow._api.v2.compat.v1 import app
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\__init__.py", line 39, in <module>
from . import v1
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\__init__.py", line 32, in <module>
from . import compat
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\__init__.py", line 39, in <module>
from . import v1
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_core\_api\v2\compat\v1\compat\v1\__init__.py", line 667, in <module>
from tensorflow_estimator.python.estimator.api._v1 import estimator
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 33, in <module>
from tensorflow_estimator.python.estimator import estimator
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 53, in <module>
from tensorflow_estimator.python.estimator import util as estimator_util
File "G:\ProgramFiles\Anaconda37\envs\tensorflow\lib\site-packages\tensorflow_estimator\python\estimator\util.py", line 75, in <module>
class _DatasetInitializerHook(tf.compat.v1.train.SessionRunHook):
AttributeError: module 'tensorflow' has no attribute 'compat'
最佳答案
这通常是由损坏的 TensorFlow-estimator 模块引起的。
简单地做一个
pip install tensorflow-estimator==2.1.*
关于python - AttributeError : module 'tensorflow' has no attribute 'compat' when loading tf. compat.v1.train.SessionRunHook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62622704/
在 Tensorflow(从 v1.2.1 开始)中,似乎有(至少)两个并行 API 来构建计算图。 tf.nn 中有函数,如 conv2d、avg_pool、relu、dropout,tf.laye
我正在处理眼睛轨迹数据和卷积神经网络。我被要求使用 tf.reduce_max(lastconv, axis=2)代替 MaxPooling 层和 tf.reduce_sum(lastconv,axi
TensorFlow 提供了 3 种不同的数据存储格式 tf.train.Feature .它们是: tf.train.BytesList tf.train.FloatList tf.train.In
我正在尝试为上下文强盗问题 (https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part
我在使用 Tensorflow 时遇到问题: 以下代码为卷积 block 生成正确的图: def conv_layer(self, inputs, filter_size = 3, num_filte
我正在将我的训练循环迁移到 Tensorflow 2.0 API .在急切执行模式下,tf.GradientTape替换 tf.gradients .问题是,它们是否具有相同的功能?具体来说: 在函数
tensorflow 中 tf.control_dependencies(tf.get_collection(tf.GraphKeys.UPDATE_OPS)) 的目的是什么? 更多上下文:
我一直在努力学习 TensorFlow,我注意到不同的函数用于相同的目标。例如,为了平方变量,我看到了 tf.square()、tf.math.square() 和 tf.keras.backend.
我正在尝试使用自动编码器开发图像着色器。有 13000 张训练图像。如果我使用 tf.data,每个 epoch 大约需要 45 分钟,如果我使用 tf.utils.keras.Sequence 大约
我尝试按照 tensorflow 教程实现 MNIST CNN 神经网络,并找到这些实现 softmax 交叉熵的方法给出了不同的结果: (1) 不好的结果 softmax = tf.nn.softm
其实,我正在coursera上做deeplearning.ai的作业“Art Generation with Neural Style Transfer”。在函数 compute_layer_styl
训练神经网络学习“异或” 我正在尝试使用“批量归一化”,我创建了一个批量归一化层函数“batch_norm1”。 import tensorflow as tf import nump
我正在尝试协调来自 TF“图形和 session ”指南以及 TF“Keras”指南和 TF Estimators 指南的信息。现在在前者中它说 tf.Session 使计算图能够访问物理硬件以执行图
我正在关注此处的多层感知器示例:https://github.com/aymericdamien/TensorFlow-Examples我对函数 tf.nn.softmax_cross_entropy
回到 TensorFlow = 2.0 中消失了。因此,像这样的解决方案...... with tf.variable_scope("foo"): with tf.variable_scope
我按照官方网站中的步骤安装了tensorflow。但是,在该网站中,作为安装的最后一步,他们给出了一行代码来“验证安装”。但他们没有告诉这段代码会给出什么输出。 该行是: python -c "imp
代码: x = tf.constant([1.,2.,3.], shape = (3,2,4)) y = tf.constant([1.,2.,3.], shape = (3,21,4)) tf.ma
我正在尝试从 Github 训练一个 3D 分割网络.我的模型是用 Keras (Python) 实现的,这是一个典型的 U-Net 模型。模型,总结如下, Model: "functional_3"
我正在使用 TensorFlow 2。我正在尝试优化一个函数,该函数使用经过训练的 tensorflow 模型(毒药)的损失。 @tf.function def totalloss(x): x
试图了解 keras 优化器中的 SGD 优化代码 (source code)。在 get_updates 模块中,我们有: # momentum shapes = [K.int_shape(p) f
我是一名优秀的程序员,十分优秀!