zl程序教程

您现在的位置是:首页 >  系统

当前栏目

ubuntu 系统问题记录

Ubuntu系统 记录 问题
2023-09-14 09:07:10 时间

U盘挂载

在这里插入图片描述
处理方法如下:
1、Ubuntu 13.10 或以上,安装exfat-fuse:

sudo apt-get install exfat-fuse

2、Ubuntu 13.04 或以下:

sudo apt-add-repository ppa:relan/exfat
sudo apt-get update
sudo apt-get install fuse-exfat

No matching distribution found for py-opencv

(base) wf@ubuntu:~/Downloads$ pip install py-opencv
ERROR: Could not find a version that satisfies the requirement py-opencv (from versions: none)
ERROR: No matching distribution found for py-opencv


(base) wf@ubuntu:~/Downloads$ sudo apt-get update
[sudo] password for wf: 
Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease                     
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]     
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]    
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]  
Fetched 325 kB in 2s (116 kB/s)                             
Reading package lists... Done

(base) wf@ubuntu:~/Downloads$ pip install opencv-python
Collecting opencv-python
  Downloading opencv_python-4.4.0.46-cp36-cp36m-manylinux2014_x86_64.whl (49.5 MB)
     |████████████████████████████████| 49.5 MB 9.7 MB/s 
Requirement already satisfied: numpy>=1.13.3 in /home/wf/anaconda3/lib/python3.6/site-packages (from opencv-python) (1.14.3)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.4.0.46

验证:

(base) wf@ubuntu:~/Downloads$ python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2

在这里插入图片描述

torch.load with map_location=‘cpu’

 raise RuntimeError('Attempting to deserialize object on a CUDA '
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location='cpu' to map your storages to the CPU.

出错语句:

saved_state_dict = torch.load(args.restore_from)

改成:

# saved_state_dict = torch.load(args.restore_from)
saved_state_dict = torch.load(args.restore_from, map_location='cpu')