pytorch版本查看和升级到相应的版本

it2026-02-25  7

1. 版本查看

import torch print(torch.__version__)

结果:

'1.0.0'

2. 升级到特定的版本

$ pip install --upgrade torch==1.4.0

结果:

Installing collected packages: torch Found existing installation: torch 1.0.0 Uninstalling torch-1.0.0: Successfully uninstalled torch-1.0.0 Successfully installed torch-1.4.0
最新回复(0)