我想在Pycharm中使用Jupyter笔记本。项目解释器是来自WSL(ubuntu 18.04)内部虚拟环境的python2.7。
Jupiter软件包已正确安装在虚拟环境中(我可以通过运行它jupyter notebook)。
我的问题是,当我想在Pycharm中使用Jupyter笔记本时,出现以下错误:(Run Error Jupyter package is not installed参见图片)。
知道这里发生了什么吗?
我正在tensorflow 网站上尝试训练和评估示例。具体来说,这部分内容:
import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()
x_train = x_train.reshape(60000, 784).astype('float32') / 255
x_test = x_test.reshape(10000, 784).astype('float32') / 255
y_train = y_train.astype('float32')
y_test = y_test.astype('float32')
def get_uncompiled_model():
inputs = keras.Input(shape=(784,), name='digits')
x = layers.Dense(64, activation='relu', name='dense_1')(inputs)
x = layers.BatchNormalization()(x)
x = layers.Dense(64, activation='relu', name='dense_2')(x)
outputs = layers.Dense(10, activation='softmax', name='predictions')(x)
model = keras.Model(inputs=inputs, outputs=outputs)
return model
def get_compiled_model():
model = get_uncompiled_model()
model.compile(optimizer=keras.optimizers.RMSprop(learning_rate=1e-3),
loss='sparse_categorical_crossentropy', …Run Code Online (Sandbox Code Playgroud) 我想使用Google云端存储客户端库函数.
为此,我必须这样做import cloudstorage.为了让cloudstorage我下载Google云端存储客户端库.
我尝试导入cloudstorage使用python -c "import cloudstorage".我收到以下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/fghavamian/Documents/PhD_work/Codes/python/convnet_gcloud/cloudstorage/__init__.py", line 20, in <module>
from .api_utils import RetryParams
File "/Users/fghavamian/Documents/PhD_work/Codes/python/convnet_gcloud/cloudstorage/api_utils.py", line 173
except self.retriable_exceptions, e:
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我错过了什么吗?
我正在尝试在 WSL 2 上安装 Cuda。我正在遵循诸如此类的说明。
执行完每个步骤后,我尝试通过执行来检查 gpu 在 Linux 环境中是否可用docker run --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark(如上述说明所建议)。
但我收到以下错误:
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled。
有什么想法可能是什么原因造成的吗?
我想使用Google Cloud Storage客户端库功能。
为此,我必须导入cloudstorag。要获取cloudstorage我下载的Google Cloud Storage客户端库。
我尝试使用导入cloudstorage python -c "import cloudstorage"。我收到以下错误:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "cloudstorage/__init__.py", line 20, in <module>
from .api_utils import RetryParams
File "cloudstorage/api_utils.py", line 45, in <module>
from google.appengine.api import app_identity
ImportError: No module named google.appengine.api
Run Code Online (Sandbox Code Playgroud)
我想念什么吗?