Keras-CPU及Pytorch-GPU安装

Pytorch-GPU安装

conda create -n torchenvGPU python=3.8

conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch

conda install ipykernel

python -m ipykernel install --user --name torchenvGPU --display-name “Python [conda env: torchenvGPU]”

测试

import torch
print(torch.version)
print(torch.version.cuda)
print(torch.cuda.is_available())
print(torch.cuda.get_device_name())

Keras-CPU安装

conda create -n kerasenv python=3.8
conda install tensorflow
conda install keras

conda install ipykernel

python -m ipykernel install --user --name kerasenv --display-name “Python [conda env: kerasenv]”

测试

import keras

你可能感兴趣的:(python)