我是TensorFlow的新手.我最近安装了它(Windows CPU版本)并收到以下消息:
成功安装了tensorflow-1.4.0 tensorflow-tensorboard-0.4.0rc2
然后,当我试图跑
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
'Hello, TensorFlow!'
a = tf.constant(10)
b = tf.constant(32)
sess.run(a + b)
42
sess.close()
Run Code Online (Sandbox Code Playgroud)
(我通过https://github.com/tensorflow/tensorflow找到)
我收到以下消息:
2017-11-02 01:56:21.698935:IC:\ tf_jenkins\home\workspace\rel-win\M\windows\PY\36\tensorflow\core\platform\cpu_feature_guard.cc:137]你的CPU支持这个说明TensorFlow二进制文件未编译使用:AVX AVX2
但是当我跑的时候
import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
print(sess.run(hello))
Run Code Online (Sandbox Code Playgroud)
它运行应该和输出Hello, TensorFlow!,这表明安装确实成功,但还有其他错误.
你知道问题是什么以及如何解决它?谢谢.
我正在尝试在Windows上安装TensorFlow.
我尝试安装它pip,但我总是得到相同的错误消息:
... is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)
我首先尝试使用Python 3.5.1,现在我升级到3.6.0b4,但它没有任何区别.
蟒蛇:
Python 3.6.0b4 (default, Nov 22 2016, 05:30:12) [MSC v.1900 64 bit (AMD64)] on win32
Run Code Online (Sandbox Code Playgroud)
PIP:
pip 9.0.1 from ...\python\lib\site-packages (python 3.6)
Run Code Online (Sandbox Code Playgroud)
确切地说,我尝试了以下两个命令:
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl
Run Code Online (Sandbox Code Playgroud)
他们输出以下内容:
> tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
> tensorflow_gpu-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
Run Code Online (Sandbox Code Playgroud)
有谁知道如何解决这个问题?我不确定我在哪里弄错了.
谢谢!
顺便说一句,我也尝试过pip install tensorflow …
我是深度学习的新手,过去 2 天我一直在尝试在我的电脑上安装 tensorflow-gpu 版本,但徒劳无功。我避免安装 CUDA 和 cuDNN 驱动程序,因为由于许多兼容性问题,几个在线论坛不推荐它。由于我之前已经在使用 python 的 conda 发行版,所以我conda install -c anaconda tensorflow-gpu按照他们的官方网站上写的那样去:https : //anaconda.org/anaconda/tensorflow-gpu。
然而,即使在新的虚拟环境中安装了 gpu 版本后(为了避免与基础环境中安装的 pip 库的潜在冲突),由于某种神秘的原因,tensorflow 似乎甚至无法识别我的 GPU。
我运行的一些代码片段(在 anaconda 提示符下)以了解它无法识别我的 GPU:-
1.
>>>from tensorflow.python.client import device_lib
>>>print(device_lib.list_local_devices())
[name: "/device:CPU:0"
device_type: "CPU"
memory_limit: 268435456
locality {
}
incarnation: 7692219132769779763
]
Run Code Online (Sandbox Code Playgroud)
如您所见,它完全忽略了 GPU。
2.
>>>tf.debugging.set_log_device_placement(True)
>>>a = tf.constant([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
2020-12-13 10:11:30.902956: I tensorflow/core/platform/cpu_feature_guard.cc:142] This
TensorFlow
binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to …Run Code Online (Sandbox Code Playgroud) 我最近开始使用 azure 进行 ML 并尝试使用机器学习服务工作区。因为我需要使用 GPU 上的图像训练 NN,所以我已经设置了一个工作区,计算设置为 NC6s-V2 机器。
问题是训练仍然在 CPU 上进行——日志说它无法找到 CUDA。这是运行我的脚本时的警告日志。任何线索如何解决这个问题?
我还在估算器的 conda 包选项中明确提到了 tensorflow-gpu 包。
这是我的估算器代码,
script_params = {
'--input_data_folder': ds.path('dataset').as_mount(),
'--zip_file_name': 'train.zip',
'--run_mode': 'train'
}
est = Estimator(source_directory='./scripts',
script_params=script_params,
compute_target=compute_target,
entry_script='main.py',
conda_packages=['scikit-image', 'keras', 'tqdm', 'pillow', 'matplotlib', 'scipy', 'tensorflow-gpu']
)
run = exp.submit(config=est)
run.wait_for_completion(show_output=True)
Run Code Online (Sandbox Code Playgroud)
计算目标是根据github上的示例代码制作的:
compute_name = "P100-NC6s-V2"
compute_min_nodes = 0
compute_max_nodes = 4
vm_size = "STANDARD_NC6S_V2"
if compute_name in ws.compute_targets:
compute_target = ws.compute_targets[compute_name]
if compute_target and type(compute_target) is AmlCompute:
print('found compute target. just use it. …Run Code Online (Sandbox Code Playgroud) tensorflow ×4
python ×3
anaconda ×1
avx ×1
azure-machine-learning-service ×1
cpu ×1
gpu ×1
installation ×1
python-3.x ×1