我有一个关于这个导入的问题 tensorflow / tensorflow / python / summary / summary.py第53行:
gen_logging_ops
当我进入目录 tensorflow / python / ops 时,没有名为D:\Python\Anaconda3\envs\tensorflow\python.exe D:/Python/pycharm_project/test/mnist_chuji
2017-08-15 14:07:37.587932: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE instructions, but these are available on your machine and could speed up CPU computations.
2017-08-15 14:07:37.588611: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-15 14:07:37.589142: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE3 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-15 14:07:37.589598: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-15 14:07:37.590038: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-08-15 14:07:37.590437: W c:\tf_jenkins\home\workspace\release-win\device\cpu\os\windows\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
Traceback (most recent call last):
File "D:/Python/pycharm_project/test/mnist_chuji", line 52, in <module>
DisplayArray(u_init, rng=[-0.1, 0.1])
File "D:/Python/pycharm_project/test/mnist_chuji", line 15, in DisplayArray
Image.fromarray(a).save(f, fmt)
AttributeError: type object 'Image' has no attribute 'fromarray'
Process finished with exit code 1
的文件。
我想知道这是怎么产生的?顺便说一句,我正在跟踪r1.3版本。
任何建议都非常感谢!
答案 0 :(得分:1)
我有一个类似的question。 gen _ 文件是由bazel在构建时生成的文件,如果您自己构建TensorFlow,可以在 bazel-genfiles / 目录中找到它们。
tf_op_gen_wrapper_py
bazel规则是生成 gen _ 文件的规则。如上所述,在此answer中,此规则生成此library中定义的操作的所有python包装器:
py_library(
name = "logging_ops",
srcs = ["ops/logging_ops.py"],
srcs_version = "PY2AND3",
deps = [
":framework_for_generated_wrappers",
":logging_ops_gen",
":util",
],
)
在logging_ops
案例中存在间接:tf_op_gen_wrapper_py
中隐藏了对tf_gen_op_wrapper_private_py
的调用:
tf_gen_op_wrapper_private_py(
name = "logging_ops_gen",
visibility = [
"//learning/brain/python/ops:__pkg__",
"//tensorflow/python/kernel_tests:__pkg__",
],
)