[英]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.