python 3.7的tensorflow导入问题 [英] tensorflow import issue for python 3.7

查看:72
本文介绍了python 3.7的tensorflow导入问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在为 python 3.7 安装 tensorflow 后,我尝试导入它,但它给了我一个语法错误.用于安装的命令:sudo -H pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl

我认为 tensorflow 还不支持 python3.7.有办法解决吗?

在此处输入图片描述

解决方案

tensorflow import for python 3.7适用于 Anaconda 2019.03 和 Python 3.7 版本

用于 CPU

创建命令:

conda create -n tensorflow_env tensorflow

激活命令:

conda 激活 tensorflow_env

导入命令:

(tensorflow_env) C:\WINDOWS\system32>python

<块引用><块引用><块引用>

将 tensorflow 导入为 tf

打印(tf.版本)

GPU

创建命令:

conda create -n tensorflow_gpuenv tensorflow-gpu

激活命令:

conda 激活 tensorflow_gpuenv

导入命令:

(tensorflow_gpuenv) C:\WINDOWS\system32>python

<块引用><块引用><块引用>

将 tensorflow 导入为 tf

打印(tf.版本)

After installing tensorflow for python 3.7, I tried to import it but it gave me a syntax error. the command used for installation : sudo -H pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.0-py3-none-any.whl

I don't think tensorflow has supported python3.7 yet. Is there a way to fix it?

enter image description here

解决方案

tensorflow import for python 3.7 for Anaconda 2019.03 with Python 3.7 version

for CPU

create command:

conda create -n tensorflow_env tensorflow

activate command:

conda activate tensorflow_env

Import command:

(tensorflow_env) C:\WINDOWS\system32>python

import tensorflow as tf

print(tf.version)

for GPU

create command:

conda create -n tensorflow_gpuenv tensorflow-gpu

activate command:

conda activate tensorflow_gpuenv

Import command:

(tensorflow_gpuenv) C:\WINDOWS\system32>python

import tensorflow as tf

print(tf.version)

这篇关于python 3.7的tensorflow导入问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆