How to install pytorch in ubuntu?
conda install pytorch torchvision torchaudio cpuonly -c pytorch1.You'd better install packages one by one.
2.After enter the command, then you may see "there are some packages will be downloaded".
If the network is not well, you'd better cancel the installing processing and then download it by some tools.
After that downloading by yourself, copy the package to "miniconda/pkgs/" directory.
3.Edit "miniconda3/lib/python3.9/site-packages/conda/gateways/connection/download.py".
Find the download function, then add some lines at the beging of it.
from ...base.constants import CONDA_TEMP_EXTENSION
tmp_file_path = target_full_path + CONDA_TEMP_EXTENSION
if exists(tmp_file_path):
print("\n[Download patch] file exists: %s", tmp_file_path)
checksum_ok = True
if sha256 or md5:
builder = hashlib.new("sha256" if sha256 else "md5")
checksum = sha256 if sha256 else md5
with open(tmp_file_path, 'rb') as f:
for chunk in iter(lambda: f.read(4096), b''):
builder.update(chunk)
actual_checksum = builder.hexdigest()
if actual_checksum != checksum:
print("\n[Download patch] cached file checksum mismatch: %s (%s != %s)",
checksum_type, actual_checksum, checksum)
checksum_ok = actual_checksum == checksum
if checksum_ok:
from ..disk.update import backoff_rename
backoff_rename(tmp_file_path, target_full_path, True)
if progress_update_callback:
progress_update_callback(1.0)
print("\n[Download patch] using cached file instead of download", target_full_path)
return
4.Get a package information.
conda search package_name --info
标签: DL
日历
最新微语
- 有的时候,会站在分叉路口,不知道向左还是右
2023-12-26 15:34
- 繁花乱开,鸟雀逐风。心自宁静,纷扰不闻。
2023-03-14 09:56
- 对于不可控的事,我们保持乐观,对于可控的事情,我们保持谨慎。
2023-02-09 11:03
- 小时候,
暑假意味着无忧无虑地玩很长一段时间,
节假意味着好吃好喝还有很多长期不见的小朋友来玩...
长大后,
这是女儿第一个暑假,
一个半月...
2022-07-11 08:54
- Watching the autumn leaves falling as you grow older together
2018-10-25 09:45
分类
最新评论
- Goonog
i get it now :) - 萧
@Fluzak:The web host... - Fluzak
Nice blog here! Also... - Albertarive
In my opinion you co... - ChesterHep
What does it plan? - ChesterHep
No, opposite. - mojoheadz
Everything is OK!... - Josephmaigh
I just want to say t... - ChesterHep
What good topic - AnthonyBub
Certainly, never it ...
发表评论: