Try   HackMD

15. 台灣杉三號 自訂pip target 安裝位置

tags: 台北榮總

課程重點: 學習如何自訂pip target 安裝位置

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Where do I start?

自訂 pytorch 安裝位置, 使用時請去除安裝步驟即可

## 下載變更 pip target位置函示庫
!wget -q https://raw.githubusercontent.com/c00cjz00/slurmjob/main/imageinit.py -O imageinit.py

## 自動重新載入
%load_ext autoreload
%reload_ext autoreload
%autoreload 2

## 設定安裝目錄, 安裝位置為 /work/c00cjz002/myenv_TMP/.package_mycolab_pytorch_nchc_conda
from imageinit import myimage
myENV='mycolab_pytorch'
resetPackage=""
myimage(myENV,resetPackage)

## 安裝pytorch套件 , 以下若出現錯誤, 請在最後補上 --no-user
!pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio==0.10.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html

## pytorch版本確認
import torch
print(torch.cuda.is_available())
print(torch.__version__)

自訂 tensorflow 安裝位置, 使用時請去除安裝步驟即可

## 下載變更 pip target位置函示庫
!wget -q https://raw.githubusercontent.com/c00cjz00/slurmjob/main/imageinit.py -O imageinit.py

## 自動重新載入
%load_ext autoreload
%reload_ext autoreload
%autoreload 2

## 設定安裝目錄, 安裝位置為 /work/c00cjz002/myenv_TMP/.package_mycolab_tensorflow_nchc_conda
from imageinit import myimage
myENV='mycolab_tensorflow'
resetPackage=""
myimage(myENV,resetPackage)

## 安裝tensorflow套件, 以下若出現錯誤, 請在最後補上 --no-user
!pip install -qq tensorflow click==7.1.2

## tensorflow 版本確認
import tensorflow as tf
print("Num GPUs Available: ", len(tf.config.list_physical_devices('GPU')))
print(tf.__version__)