[英]running Keras on macOs through the terminal with python installed?
当我在 macOS 上的终端中键入命令“从 tensorflow 导入 keras”时,我得到
“来自:无法读取 /var/mail/tensorflow”
您不能直接将 Python 代码写入 CLI。 那在某种程度上只接受 shell 命令。
您可以:
$ python3
Python 3.9.4 (default, Apr 5 2021, 01:50:46)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tensorflow import keras
my_first_script.py
之类的名称,例如#!/usr/bin/env python3
import tensorflow as tf
from tensorflow import keras
# the rest of your code
然后你用 python 运行它,例如
$ python my_first_script.py
在这里查看本教程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.