AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-165324

Mona Jalal's questions

Martin Hope
Mona Jalal
Asked: 2022-04-02 16:16:40 +0800 CST

泊坞窗:来自守护进程的错误响应:无法选择具有功能的设备驱动程序“”:[[gpu]]

  • 1

尽管有 4 个 GPU,每个 GPU 都有 ~20GB 的 vRAM,但 docker 无法使用以下命令运行。我该如何解决这个问题?

[20:08:28] jalal@echo:~/research/code$ docker run --shm-size 2GB -it --gpus all docurdt/heal
docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]].
ERRO[0000] error waiting for container: context canceled 


[20:08:20] jalal@echo:~/research/code$ nvidia-smi
Fri Apr  1 20:08:28 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 510.47.03    Driver Version: 510.47.03    CUDA Version: 11.6     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
| 31%   41C    P8    23W / 350W |    301MiB / 24576MiB |      1%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   1  NVIDIA GeForce ...  Off  | 00000000:21:00.0 Off |                  N/A |
| 30%   39C    P8    18W / 350W |     14MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   2  NVIDIA GeForce ...  Off  | 00000000:4A:00.0 Off |                  N/A |
| 30%   32C    P8    23W / 350W |     14MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
|   3  NVIDIA GeForce ...  Off  | 00000000:4B:00.0 Off |                  N/A |
| 30%   40C    P8    18W / 350W |     14MiB / 24576MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

我也有:

$ uname -a
Linux echo 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
$ lsb_release -a
LSB Version:    core-11.1.0ubuntu2-noarch:security-11.1.0ubuntu2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:    20.04
Codename:   focal

$ docker -v
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

还,

$ df -h | grep /dev/shm
tmpfs                                126G  199M  126G   1% /dev/shm

和

在此处输入图像描述

和

$  cat /boot/config-$(uname -r) | grep -i seccomp
CONFIG_SECCOMP=y
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
CONFIG_SECCOMP_FILTER=y

和

[20:33:17] (dpcc) jalal@echo:~$ lspci -vv | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation Device 2204 (rev a1) (prog-if 00 [VGA controller])
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
01:00.1 Audio device: NVIDIA Corporation Device 1aef (rev a1)
21:00.0 VGA compatible controller: NVIDIA Corporation Device 2204 (rev a1) (prog-if 00 [VGA controller])
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
21:00.1 Audio device: NVIDIA Corporation Device 1aef (rev a1)
4a:00.0 VGA compatible controller: NVIDIA Corporation Device 2204 (rev a1) (prog-if 00 [VGA controller])
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
4a:00.1 Audio device: NVIDIA Corporation Device 1aef (rev a1)
4b:00.0 VGA compatible controller: NVIDIA Corporation Device 2204 (rev a1) (prog-if 00 [VGA controller])
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
4b:00.1 Audio device: NVIDIA Corporation Device 1aef (rev a1)
drivers
  • 1 个回答
  • 4397 Views
Martin Hope
Mona Jalal
Asked: 2022-04-02 14:46:53 +0800 CST

docker:来自守护进程的错误响应:获取 https://registry-1.docker.io/v2/:net/http:请求在等待连接时取消

  • 0

如何在 Ubuntu 20.04 中解决此问题?

[18:31:29] (dpcc) jalal@echo:~/research/code$ sudo docker pull docurdt/heal
[sudo] password for jalal: 
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)


$ uname -a
Linux echo 5.4.0-99-generic #112-Ubuntu SMP Thu Feb 3 13:50:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux


$ docker --version
Docker version 20.10.7, build 20.10.7-0ubuntu5~20.04.2

我对 CentOS 7 上的这个 $ docker pull 没有问题。

这是我使用的代理~/.bashrc:

export http_proxy="http://webproxy.bu.edu:8900"
export https_proxy="http://webproxy.bu.edu:8900"
export ftp_proxy="http://webproxy.bu.edu:8900"
export rsync_proxy=$http_proxy
export no_proxy="localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10."

添加了这些,config.json但注销后错误仍然存​​在:

$ cat ~/.docker/config.json 
{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://webproxy.bu.edu:8900",
     "httpsProxy": "http://webproxy.bu.edu:8900",
     "noProxy": "localhost,127.0.0.1,.bu.edu,.ad.bu.edu,128.197.,10."
   }
 }
}

我得到:

[19:38:02] jalal@echo:~/research/code$ docker pull docurdt/heal
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
20.04
  • 1 个回答
  • 5501 Views
Martin Hope
Mona Jalal
Asked: 2022-03-18 09:00:39 +0800 CST

rsyncing 前 100 个文件夹以进行性能测试

  • 0

我正在尝试测量我们服务器之间新设置的 NFS 驱动器的性能,因此我正在尝试同步 100 个大文件。我有 400 个文件夹,每个文件夹只包含一个大文件。我怎样才能同步它们?以下命令给了我一个错误:

[12:53:56] jalal@ayan:/SeaExp_1/400_folders$ time rsync -arv `ls | head -n 100`  /SeaExpNFS/100_folders --progress
rsync: -rw-rw-rw-: unknown option
rsync error: syntax or usage error (code 1) at main.c(1585) [client=3.1.2]

real    0m0.039s
user    0m0.011s
sys     0m0.012s

其中两台服务器是 Ubuntu 20.04,另一台是 Ubuntu 18.04。NFS 由 IT 管理。这里,/SeaExpNFS是 NFS 驱动器,/SeaExp_1是一个外部 HDD。

rsync
  • 1 个回答
  • 56 Views
Martin Hope
Mona Jalal
Asked: 2021-12-01 13:00:45 +0800 CST

awk -- 复制一列并修改其文本

  • 0
awk {'printf ("%5s\t%s\n", $0, $NF)'} test_VN.txt

适用于在文本文件中复制列但是,如何在复制列的扩展_VN之前添加?.jpeg

例如,我想要这个输出:

21_48.jpeg  21_48_VN.jpeg
24_48.jpeg  24_48_VN.jpeg
25_48.jpeg  25_48_VN.jpeg

我想从只有一列的 test_VN.txt 中读取第一列,并将其保存到包含两列的 test_VN_2.txt 中。

*是的,我的意图是在两列之间进行制表符分隔。

text-processing
  • 1 个回答
  • 64 Views
Martin Hope
Mona Jalal
Asked: 2021-01-30 19:46:43 +0800 CST

E:未满足的依赖关系。尝试不带软件包的“apt --fix-broken install”(或指定解决方案)。Ubuntu 20.04 上缺少 libpng12-0

  • 1

我正在尝试升级 apt,但出现以下错误。我应该如何解决它?

mona@goku:~$ sudo apt update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu focal InRelease                                                              
Hit:3 https://download.docker.com/linux/ubuntu focal InRelease                                                         
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease                                                       
Hit:5 http://ppa.launchpad.net/nm-l2tp/network-manager-l2tp/ubuntu focal InRelease                                     
Hit:6 http://deb.anydesk.com all InRelease                                                                             
Hit:7 https://packages.microsoft.com/repos/ms-teams stable InRelease                                                   
Hit:8 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease                                                      
Hit:9 http://archive.ubuntu.com/ubuntu xenial InRelease                                                                
Hit:10 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease                                                 
Hit:11 http://lenovo.archive.canonical.com focal InRelease                                     
Hit:12 http://ppa.launchpad.net/zeehio/libxp/ubuntu focal InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
119 packages can be upgraded. Run 'apt list --upgradable' to see them.
mona@goku:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mona@goku:~$ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mona@goku:~$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cpp-7 libpython-dev libpython2.7-dev libpython3-dev python2.7-dev python3-decorator python3-ipython-genutils
  python3-jupyter-core python3-traitlets python3.8-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpng12-0
The following NEW packages will be installed:
  libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 119 not upgraded.
5 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 408627 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
 unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while p
rocessing:
 /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

和

mona@goku:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cpp-7 libpython-dev libpython2.7-dev libpython3-dev python2.7-dev python3-decorator python3-ipython-genutils
  python3-jupyter-core python3-traitlets python3.8-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libpng12-0
The following NEW packages will be installed:
  libpng12-0
0 upgraded, 1 newly installed, 0 to remove and 119 not upgraded.
5 not fully installed or removed.
Need to get 0 B/116 kB of archives.
After this operation, 285 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 408627 files and directories currently installed.)
Preparing to unpack .../libpng12-0_1.2.54-1ubuntu1_amd64.deb ...
Unpacking libpng12-0:amd64 (1.2.54-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb (--unpack):
 unable to install new version of '/lib/x86_64-linux-gnu/libpng12.so.0': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Errors were encountered while processing:
 /var/cache/apt/archives/libpng12-0_1.2.54-1ubuntu1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

和

mona@goku:~$ sudo dpkg --configure -a 
dpkg: dependency problems prevent configuration of libopencv-highgui2.4v5:amd64:
 libopencv-highgui2.4v5:amd64 depends on libpng12-0 (>= 1.2.13-4); however:
  Package libpng12-0:amd64 is not installed.

dpkg: error processing package libopencv-highgui2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-objdetect2.4v5:amd64:
 libopencv-objdetect2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-objdetect2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-contrib2.4v5:amd64:
 libopencv-contrib2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.
 libopencv-contrib2.4v5:amd64 depends on libopencv-objdetect2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-objdetect2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-contrib2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libopencv-legacy2.4v5:amd64:
 libopencv-legacy2.4v5:amd64 depends on libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1); however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.

dpkg: error processing package libopencv-legacy2.4v5:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python-opencv:
 python-opencv depends on libopencv-contrib2.4v5; however:
  Package libopencv-contrib2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-highgui2.4v5; however:
  Package libopencv-highgui2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-legacy2.4v5; however:
  Package libopencv-legacy2.4v5:amd64 is not configured yet.
 python-opencv depends on libopencv-objdetect2.4v5; however:
  Package libopencv-objdetect2.4v5:amd64 is not configured yet.

dpkg: error processing package python-opencv (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
Errors were encountered while processing:
 libopencv-highgui2.4v5:amd64
 libopencv-objdetect2.4v5:amd64
 libopencv-contrib2.4v5:amd64
 libopencv-legacy2.4v5:amd64
 python-opencv

和

mona@goku:~$ sudo apt autoremove
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

和:

mona@goku:~$ namei -l /lib/x86_64-linux-gnu/libpng12.so.0
f: /lib/x86_64-linux-gnu/libpng12.so.0
drwxr-xr-x root root /
lrwxrwxrwx root root lib -> usr/lib
drwxr-xr-x root root   usr
drwxr-xr-x root root   lib
drwxr-xr-x root root x86_64-linux-gnu
                     libpng12.so.0 - No such file or directory

和

mona@goku:~$ sudo apt purge libopencv-highgui2.4v5 libpng12-0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libpng12-0' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libopencv-contrib2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 libopencv-legacy2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 libopencv-objdetect2.4v5 : Depends: libopencv-highgui2.4v5 (= 2.4.9.1+dfsg-1.5ubuntu1) but it is not going to be installed
 python-opencv : Depends: libopencv-highgui2.4v5 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
apt
  • 1 个回答
  • 2480 Views
Martin Hope
Mona Jalal
Asked: 2021-01-29 16:08:28 +0800 CST

在 Ubuntu 20.04 上安装 open3d [重复]

  • 2
这个问题在这里已经有了答案:
如何让 `dpkg -i` 为我安装依赖项? (11 个回答)
如何恢复默认存储库? (4 个回答)
去年关闭。

我想在 Ubuntu 20.04 上安装 Open3D,但出现以下错误。我该如何解决?

mona@goku:~$ wget https://github.com/intel-isl/Open3D/releases/download/v0.12.0/open3d-app-0.12.0-Ubuntu_20.04.deb
--2021-01-28 19:03:24--  https://github.com/intel-isl/Open3D/releases/download/v0.12.0/open3d-app-0.12.0-Ubuntu_20.04.deb
Resolving github.com (github.com)... 140.82.113.4
Connecting to github.com (github.com)|140.82.113.4|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-releases.githubusercontent.com/75413130/8cd1a380-4e88-11eb-9639-e33b0a383434?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210129%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210129T000324Z&X-Amz-Expires=300&X-Amz-Signature=5f04a7b6d5eee8340ea6f3ebaf8fb2ac5a949d2e1bbfba71bcac6a3eea365a11&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75413130&response-content-disposition=attachment%3B%20filename%3Dopen3d-app-0.12.0-Ubuntu_20.04.deb&response-content-type=application%2Foctet-stream [following]
--2021-01-28 19:03:24--  https://github-releases.githubusercontent.com/75413130/8cd1a380-4e88-11eb-9639-e33b0a383434?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20210129%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20210129T000324Z&X-Amz-Expires=300&X-Amz-Signature=5f04a7b6d5eee8340ea6f3ebaf8fb2ac5a949d2e1bbfba71bcac6a3eea365a11&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=75413130&response-content-disposition=attachment%3B%20filename%3Dopen3d-app-0.12.0-Ubuntu_20.04.deb&response-content-type=application%2Foctet-stream
Resolving github-releases.githubusercontent.com (github-releases.githubusercontent.com)... 185.199.110.154, 185.199.111.154, 185.199.108.154, ...
Connecting to github-releases.githubusercontent.com (github-releases.githubusercontent.com)|185.199.110.154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 110120788 (105M) [application/octet-stream]
Saving to: ‘open3d-app-0.12.0-Ubuntu_20.04.deb’

open3d-app-0.12.0-Ubuntu_20.04.d 100%[=========================================================>] 105.02M  5.11MB/s    in 22s     

2021-01-28 19:03:47 (4.74 MB/s) - ‘open3d-app-0.12.0-Ubuntu_20.04.deb’ saved [110120788/110120788]

mona@goku:~$ sudo dpkg -i open3d-app-0.12.0-Ubuntu_20.04.deb
[sudo] password for mona: 
Selecting previously unselected package open3d-viewer.
(Reading database ... 408548 files and directories currently installed.)
Preparing to unpack open3d-app-0.12.0-Ubuntu_20.04.deb ...
Unpacking open3d-viewer (0.12.0) ...
dpkg: dependency problems prevent configuration of open3d-viewer:
 open3d-viewer depends on libc++1; however:
  Package libc++1 is not installed.
 open3d-viewer depends on libglfw3; however:
  Package libglfw3 is not installed.

dpkg: error processing package open3d-viewer (--install):
 dependency problems - leaving unconfigured
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24-1ubuntu3) ...
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for shared-mime-info (1.15-1) ...
Errors were encountered while processing:
 open3d-viewer
mona@goku:~$ sudo apt install libc++1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc++1 : Depends: libc++1-10 (>= 10~) but it is not going to be installed
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
 open3d-viewer : Depends: libglfw3 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
mona@goku:~$ sudo apt --fix-broken install libc++1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libc++1 : Depends: libc++1-10 (>= 10~) but it is not going to be installed
 libopencv-highgui2.4v5 : Depends: libpng12-0 (>= 1.2.13-4) but it is not going to be installed
 open3d-viewer : Depends: libglfw3 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
apt
  • 1 个回答
  • 1543 Views
Martin Hope
Mona Jalal
Asked: 2021-01-23 19:06:26 +0800 CST

qt.qpa.plugin:即使找到了,也无法在“”中加载 Qt 平台插件“xcb”。在 ubuntu 20.04

  • 3

我应该如何在 Ubuntu 20.04 中解决这个问题?

Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

 

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

 

Aborted (core dumped)
Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

 

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

 

Aborted (core dumped)
2224/31772MB(vision) 

和

$ echo $DISPLAY
:0

和

$ python
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import inspect
>>> from PyQt5 import Qt
>>> vers = ['%s = %s' % (k,v) for k,v in vars(Qt).items() if k.lower().find('version') >= 0 and not inspect.isbuiltin(v)]
>>> print('\n'.join(sorted(vers)))
PYQT_VERSION = 331522
PYQT_VERSION_STR = 5.15.2
QOpenGLVersionProfile = <class 'PyQt5.QtGui.QOpenGLVersionProfile'>
QOperatingSystemVersion = <class 'PyQt5.QtCore.QOperatingSystemVersion'>
QT_VERSION = 331522
QT_VERSION_STR = 5.15.2
QVersionNumber = <class 'PyQt5.QtCore.QVersionNumber'>

作为重现此错误的最小代码,您可以运行以下命令:

$ cat test_qt.py 
'''
====================
3D plots as subplots
====================

Demonstrate including 3D plots as subplots.
'''

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d.axes3d import Axes3D, get_test_data
from matplotlib import cm
import numpy as np


# set up a figure twice as wide as it is tall
fig = plt.figure(figsize=plt.figaspect(0.5))

#===============
#  First subplot
#===============
# set up the axes for the first plot
ax = fig.add_subplot(1, 2, 1, projection='3d')

# plot a 3D surface like in the example mplot3d/surface3d_demo
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)
surf = ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.coolwarm,
                       linewidth=0, antialiased=False)
ax.set_zlim(-1.01, 1.01)
fig.colorbar(surf, shrink=0.5, aspect=10)

#===============
# Second subplot
#===============
# set up the axes for the second plot
ax = fig.add_subplot(1, 2, 2, projection='3d')

# plot a 3D wireframe like in the example mplot3d/wire3d_demo
X, Y, Z = get_test_data(0.05)
ax.plot_wireframe(X, Y, Z, rstride=10, cstride=10)

plt.show()

$ python test_qt.py 
Invalid MIT-MAGIC-COOKIE-1 keyqt.qpa.xcb: could not connect to display :0
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted (core dumped)

还,

$ python
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from PyQt5 import QtCore, QtGui, QtWidgets
>>> 
python
  • 1 个回答
  • 15892 Views
Martin Hope
Mona Jalal
Asked: 2021-01-06 18:51:56 +0800 CST

在 Ubuntu 20.04 中摆脱 protobuf 3.13.0 并将 protobuf 3.6.1 设置为默认值

  • 3

我最初安装了 protobuf 3.13.0,然后使用 apt remove 将其删除,但它没有被删除。

我什至按照这些说明从源代码安装了 protobuf 3.6.1,但仍然存在 3.13.0 https://askubuntu.com/a/1072684/165324

    $ protoc --version
    libprotoc 3.13.0


    $ sudo apt-get install protobuf-compiler libprotobuf-dev
    
    $ sudo apt remove protobuf-compiler libprotobuf-dev
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Package 'libprotobuf-dev' is not installed, so not removed
    Package 'protobuf-compiler' is not installed, so not removed
    The following packages were automatically installed and are no longer required:
      libprotobuf-lite17 libprotoc17 linux-image-5.4.0-58-generic linux-modules-5.4.0-58-generic
      linux-modules-extra-5.4.0-58-generic
    Use 'sudo apt autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.
$ sudo apt-get install protobuf-compiler libprotobuf-dev

$ sudo apt remove protobuf-compiler libprotobuf-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libprotobuf-dev' is not installed, so not removed
Package 'protobuf-compiler' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  libprotobuf-lite17 libprotoc17 linux-image-5.4.0-58-generic linux-modules-5.4.0-58-generic
  linux-modules-extra-5.4.0-58-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 27 not upgraded.

安装 3.6.1 使用:

$ wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz

$ tar -xvzf protobuf-all-3.6.1.tar.gz 

$ cd protobuf-3.6.1/

$ ./configure

$ make

$ make check

$ sudo make install

$ sudo ldconfig
package-management
  • 1 个回答
  • 4509 Views
Martin Hope
Mona Jalal
Asked: 2020-11-30 20:16:35 +0800 CST

在 Ubuntu 终端中保存 wmv 视频的第一和第二 2 分钟

  • 3

如何在不更改 Ubuntu 命令行中视频设置的情况下剪切 10 分钟视频的前两分钟并将其保存为 first_2min.wmv,然后将第二个 2 分钟保存为 second_2min.wmv?视频的原始格式也是 wmv。

video video-editor ffmpeg
  • 2 个回答
  • 1106 Views
Martin Hope
Mona Jalal
Asked: 2020-10-07 16:20:40 +0800 CST

如何摆脱 CUDA 内存不足而无需重新启动机器?

  • 2

Ubuntu 20.04 中是否有一个 hack 可以消除以下 CUDA 内存不足错误而无需重新启动机器?

运行时错误:CUDA 内存不足。尝试分配 40.00 MiB(GPU 0;7.80 GiB 总容量;6.34 GiB 已分配;32.44 MiB 空闲;PyTorch 总共保留 6.54 GiB)

我知道以下工作但也杀死了我的 Jupyter 笔记本。有没有办法释放 GPU 中的内存而不必杀死 Jupyter 笔记本?

(base) mona@mona:~/research/facial_landmark$ nvidia-smi
Tue Oct  6 20:28:05 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06    Driver Version: 450.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 2070    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8     9W /  N/A |   7883MiB /  7982MiB |      2%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1306      G   /usr/lib/xorg/Xorg                255MiB |
|    0   N/A  N/A      1743      G   /usr/bin/gnome-shell              151MiB |
|    0   N/A  N/A      3273      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      3359      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      3844      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      4222      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      4587      C   ...mona/anaconda3/bin/python     7459MiB |
+-----------------------------------------------------------------------------+
(base) mona@mona:~/research/facial_landmark$ kill -9  4587
(base) mona@mona:~/research/facial_landmark$ nvidia-smi
Tue Oct  6 20:28:24 2020       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 450.51.06    Driver Version: 450.51.06    CUDA Version: 11.0     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  GeForce RTX 2070    Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P8     9W /  N/A |    433MiB /  7982MiB |      4%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A      1306      G   /usr/lib/xorg/Xorg                255MiB |
|    0   N/A  N/A      1743      G   /usr/bin/gnome-shell              152MiB |
|    0   N/A  N/A      3273      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      3359      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      3844      G   /usr/lib/firefox/firefox            2MiB |
|    0   N/A  N/A      4222      G   /usr/lib/firefox/firefox            2MiB |
+-----------------------------------------------------------------------------+
(base) mona@mona:~/research/facial_landmark$ 
python nvidia gpu cuda 20.04
  • 1 个回答
  • 6663 Views
Martin Hope
Mona Jalal
Asked: 2020-09-24 22:45:19 +0800 CST

torch.cuda.is_available() 全新安装驱动程序和 cuda 后为 False

  • 0

我使用以下两个命令安装了 CUDA 和 NVIDIA 驱动程序。

$ sudo ubuntu-drivers install

$ sudo apt install nvidia-cuda-toolkit

但是,现在 cuda 在torch 中不可用。你知道我该如何解决吗?

$ python
Python 3.7.6 (default, Jan  8 2020, 19:59:22) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.__version__
'1.6.0'
>>> torch.version.cuda
'10.1'
>>> torch.cuda.is_available()
False

我也不确定为什么在安装驱动程序后 nvidia-smi 仍然无法正常工作:

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.


$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.1 LTS
Release:    20.04
Codename:   focal

$ lspci  | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation TU106M [GeForce RTX 2070 Mobile] (rev a1)
01:00.1 Audio device: NVIDIA Corporation TU106 High Definition Audio Controller (rev a1)
01:00.2 USB controller: NVIDIA Corporation TU106 USB 3.1 Host Controller (rev a1)
01:00.3 Serial bus controller [0c80]: NVIDIA Corporation TU106 USB Type-C UCSI Controller (rev a1)
drivers nvidia cuda nvidia-geforce 20.04
  • 1 个回答
  • 4791 Views
Martin Hope
Mona Jalal
Asked: 2020-09-24 20:12:42 +0800 CST

处理时遇到错误:libnvidia-compute-450-server:amd64

  • 0

我怎样才能摆脱这个包?

$ sudo dpkg --purge $(dpkg -l | grep libnvidia | awk '{print $2}')
dpkg: dependency problems prevent removal of libnvidia-compute-450-server:amd64:
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | libcuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-450-server:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450-server:amd64 which provides libcuda-10.1-1 is to be removed.
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | libcuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-450-server:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450-server:amd64 which provides libcuda-10.1-1 is to be removed.

dpkg: error processing package libnvidia-compute-450-server:amd64 (--purge):
 dependency problems - not removing
Errors were encountered while processing:
 libnvidia-compute-450-server:amd64
dpkg nvidia 20.04
  • 1 个回答
  • 201 Views
Martin Hope
Mona Jalal
Asked: 2020-09-24 17:32:20 +0800 CST

01-libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb E:子进程/usr/bin/dpkg返回错误码(1)

  • 1

我怎样才能解决这个问题?我正在遵循本指南。

(base) mona@mona:~/Downloads$ sudo ubuntu-drivers install
ERROR:root:No flavour can be found in nvidia-driver-450-server. Skipping.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cuda-command-line-tools-10-1 cuda-compiler-10-1 cuda-cudart-10-1
  cuda-cudart-dev-10-1 cuda-cufft-10-1 cuda-cufft-dev-10-1 cuda-cuobjdump-10-1
  cuda-cupti-10-1 cuda-curand-10-1 cuda-curand-dev-10-1 cuda-cusolver-10-1
  cuda-cusolver-dev-10-1 cuda-cusparse-10-1 cuda-cusparse-dev-10-1
  cuda-driver-dev-10-1 cuda-gdb-10-1 cuda-gpu-library-advisor-10-1
  cuda-license-10-1 cuda-license-10-2 cuda-memcheck-10-1
  cuda-misc-headers-10-1 cuda-npp-10-1 cuda-npp-dev-10-1 cuda-nsight-10-1
  cuda-nsight-compute-10-1 cuda-nsight-systems-10-1 cuda-nvcc-10-1
  cuda-nvdisasm-10-1 cuda-nvgraph-10-1 cuda-nvgraph-dev-10-1 cuda-nvjpeg-10-1
  cuda-nvjpeg-dev-10-1 cuda-nvml-dev-10-1 cuda-nvprof-10-1 cuda-nvprune-10-1
  cuda-nvrtc-10-1 cuda-nvrtc-dev-10-1 cuda-nvtx-10-1 cuda-nvvp-10-1
  cuda-sanitizer-api-10-1 freeglut3 freeglut3-dev libfprint-2-tod1
  libglu1-mesa-dev libice-dev libllvm9 libllvm9:i386 libnvidia-common-440
  libnvidia-common-450 libsm-dev libxext-dev libxfixes-dev libxi-dev
  libxmu-dev libxmu-headers libxt-dev nvidia-modprobe python3-click
  python3-colorama x11proto-input-dev x11proto-xext-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-cfg1-450-server libnvidia-common-450-server
  libnvidia-compute-450-server libnvidia-compute-450-server:i386
  libnvidia-decode-450-server libnvidia-decode-450-server:i386
  libnvidia-encode-450-server libnvidia-encode-450-server:i386
  libnvidia-extra-450-server libnvidia-fbc1-450-server
  libnvidia-fbc1-450-server:i386 libnvidia-gl-450-server
  libnvidia-gl-450-server:i386 libnvidia-ifr1-450-server
  libnvidia-ifr1-450-server:i386 nvidia-compute-utils-450-server
  nvidia-dkms-450-server nvidia-kernel-common-450-server
  nvidia-kernel-source-450-server nvidia-utils-450-server
  xserver-xorg-video-nvidia-450-server
The following packages will be REMOVED:
  libnvidia-cfg1-450 libnvidia-compute-450 libnvidia-decode-450
  libnvidia-encode-450 libnvidia-extra-450 libnvidia-fbc1-450 libnvidia-gl-450
  libnvidia-ifr1-450 nvidia-compute-utils-450 nvidia-utils-450
  xserver-xorg-video-nvidia-450
The following NEW packages will be installed:
  libnvidia-cfg1-450-server libnvidia-common-450-server
  libnvidia-compute-450-server libnvidia-compute-450-server:i386
  libnvidia-decode-450-server libnvidia-decode-450-server:i386
  libnvidia-encode-450-server libnvidia-encode-450-server:i386
  libnvidia-extra-450-server libnvidia-fbc1-450-server
  libnvidia-fbc1-450-server:i386 libnvidia-gl-450-server
  libnvidia-gl-450-server:i386 libnvidia-ifr1-450-server
  libnvidia-ifr1-450-server:i386 nvidia-compute-utils-450-server
  nvidia-dkms-450-server nvidia-driver-450-server
  nvidia-kernel-common-450-server nvidia-kernel-source-450-server
  nvidia-utils-450-server xserver-xorg-video-nvidia-450-server
0 upgraded, 22 newly installed, 11 to remove and 55 not upgraded.
Need to get 139 MB of archives.
After this operation, 224 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-compute-450-server amd64 450.51.06-0ubuntu0.20.04.2 [21.8 MB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-cfg1-450-server amd64 450.51.06-0ubuntu0.20.04.2 [73.8 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-common-450-server all 450.51.06-0ubuntu0.20.04.2 [8,772 B]
Get:4 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-compute-450-server i386 450.51.06-0ubuntu0.20.04.2 [22.6 MB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-decode-450-server amd64 450.51.06-0ubuntu0.20.04.2 [1,102 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-decode-450-server i386 450.51.06-0ubuntu0.20.04.2 [1,134 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-encode-450-server amd64 450.51.06-0ubuntu0.20.04.2 [38.2 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-encode-450-server i386 450.51.06-0ubuntu0.20.04.2 [38.8 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-extra-450-server amd64 450.51.06-0ubuntu0.20.04.2 [38.2 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-fbc1-450-server i386 450.51.06-0ubuntu0.20.04.2 [45.9 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-fbc1-450-server amd64 450.51.06-0ubuntu0.20.04.2 [48.5 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-gl-450-server i386 450.51.06-0ubuntu0.20.04.2 [17.2 MB]
Get:13 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-gl-450-server amd64 450.51.06-0ubuntu0.20.04.2 [60.4 MB]
Get:14 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 libnvidia-ifr1-450-server amd64 450.51.06-0ubuntu0.20.04.2 [67.2 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted i386 libnvidia-ifr1-450-server i386 450.51.06-0ubuntu0.20.04.2 [60.5 kB]
Get:16 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-compute-utils-450-server amd64 450.51.06-0ubuntu0.20.04.2 [121 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-kernel-source-450-server amd64 450.51.06-0ubuntu0.20.04.2 [11.8 MB]
Get:18 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-kernel-common-450-server amd64 450.51.06-0ubuntu0.20.04.2 [18.7 kB]
Get:19 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-dkms-450-server amd64 450.51.06-0ubuntu0.20.04.2 [36.8 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-utils-450-server amd64 450.51.06-0ubuntu0.20.04.2 [365 kB]
Get:21 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 xserver-xorg-video-nvidia-450-server amd64 450.51.06-0ubuntu0.20.04.2 [1,536 kB]
Get:22 http://us.archive.ubuntu.com/ubuntu focal-updates/restricted amd64 nvidia-driver-450-server amd64 450.51.06-0ubuntu0.20.04.2 [428 kB]
Fetched 139 MB in 42s (3,274 kB/s)                                             
(Reading database ... 224176 files and directories currently installed.)
Removing xserver-xorg-video-nvidia-450 (450.51.06-0ubuntu1) ...
Removing libnvidia-cfg1-450:amd64 (450.51.06-0ubuntu1) ...
Removing libnvidia-encode-450:amd64 (450.51.06-0ubuntu1) ...
Removing libnvidia-decode-450:amd64 (450.51.06-0ubuntu1) ...
Removing nvidia-utils-450 (450.51.06-0ubuntu1) ...
dpkg: libnvidia-compute-450:amd64: dependency problems, but removing anyway as you requested:
 nvidia-compute-utils-450 depends on libnvidia-compute-450.
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | libcuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-compute-440:amd64 which provides libcuda1 is not installed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda-10.1-1 is to be removed.
  Package libnvidia-compute-440:amd64 which provides libcuda-10.1-1 is not installed.
 libcuinj64-10.1:amd64 depends on libcuda1 (>= 418.39) | libnvidia-tesla-cuda1 (>= 418.39) | libcuda.so.1 (>= 418.39) | libcuda-10.1-1; however:
  Package libcuda1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda1 is to be removed.
  Package libnvidia-compute-440:amd64 which provides libcuda1 is not installed.
  Package libnvidia-tesla-cuda1 is not installed.
  Package libcuda.so.1 is not installed.
  Package libcuda-10.1-1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libcuda-10.1-1 is to be removed.
  Package libnvidia-compute-440:amd64 which provides libcuda-10.1-1 is not installed.
 libnvidia-ml-dev depends on libnvidia-ml1 (>= 418.39) | libnvidia-tesla-440-ml1 (>= 418.39) | libnvidia-tesla-418-ml1 (>= 418.39) | libnvidia-ml.so.1 (>= 418.39); however:
  Package libnvidia-ml1 is not installed.
  Package libnvidia-compute-450:amd64 which provides libnvidia-ml1 is to be removed.
  Package libnvidia-compute-440:amd64 which provides libnvidia-ml1 is not installed.
  Package libnvidia-tesla-440-ml1 is not installed.
  Package libnvidia-tesla-418-ml1 is not installed.
  Package libnvidia-ml.so.1 is not installed.

Removing libnvidia-compute-450:amd64 (450.51.06-0ubuntu1) ...
Selecting previously unselected package libnvidia-compute-450-server:amd64.
(Reading database ... 224121 files and directories currently installed.)
Preparing to unpack .../libnvidia-compute-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-compute-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
(Reading database ... 224136 files and directories currently installed.)
Removing libnvidia-extra-450:amd64 (450.51.06-0ubuntu1) ...
Removing libnvidia-fbc1-450:amd64 (450.51.06-0ubuntu1) ...
Removing libnvidia-ifr1-450:amd64 (450.51.06-0ubuntu1) ...
Removing libnvidia-gl-450:amd64 (450.51.06-0ubuntu1) ...
Removing nvidia-compute-utils-450 (450.51.06-0ubuntu1) ...
Selecting previously unselected package libnvidia-cfg1-450-server:amd64.
(Reading database ... 224078 files and directories currently installed.)
Preparing to unpack .../00-libnvidia-cfg1-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-cfg1-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-common-450-server.
Preparing to unpack .../01-libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb ...
Unpacking libnvidia-common-450-server (450.51.06-0ubuntu0.20.04.2) ...
dpkg: error processing archive /tmp/apt-dpkg-install-khqbUA/01-libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb (--unpack):
 trying to overwrite '/usr/share/nvidia/nvidia-application-profiles-450.51.06-key-documentation', which is also in package libnvidia-common-450 450.51.06-0ubuntu1
Selecting previously unselected package libnvidia-compute-450-server:i386.
Preparing to unpack .../02-libnvidia-compute-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-compute-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-decode-450-server:i386.
Preparing to unpack .../03-libnvidia-decode-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-decode-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-decode-450-server:amd64.
Preparing to unpack .../04-libnvidia-decode-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-decode-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-encode-450-server:amd64.
Preparing to unpack .../05-libnvidia-encode-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-encode-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-encode-450-server:i386.
Preparing to unpack .../06-libnvidia-encode-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-encode-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-extra-450-server:amd64.
Preparing to unpack .../07-libnvidia-extra-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-extra-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-fbc1-450-server:i386.
Preparing to unpack .../08-libnvidia-fbc1-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-fbc1-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-fbc1-450-server:amd64.
Preparing to unpack .../09-libnvidia-fbc1-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-fbc1-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-gl-450-server:i386.
Preparing to unpack .../10-libnvidia-gl-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-gl-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-gl-450-server:amd64.
Preparing to unpack .../11-libnvidia-gl-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-gl-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-ifr1-450-server:amd64.
Preparing to unpack .../12-libnvidia-ifr1-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking libnvidia-ifr1-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package libnvidia-ifr1-450-server:i386.
Preparing to unpack .../13-libnvidia-ifr1-450-server_450.51.06-0ubuntu0.20.04.2_i386.deb ...
Unpacking libnvidia-ifr1-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-compute-utils-450-server.
Preparing to unpack .../14-nvidia-compute-utils-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-compute-utils-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-kernel-source-450-server.
Preparing to unpack .../15-nvidia-kernel-source-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-kernel-source-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-kernel-common-450-server.
Preparing to unpack .../16-nvidia-kernel-common-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-kernel-common-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-dkms-450-server.
Preparing to unpack .../17-nvidia-dkms-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-dkms-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-utils-450-server.
Preparing to unpack .../18-nvidia-utils-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-utils-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package xserver-xorg-video-nvidia-450-server.
Preparing to unpack .../19-xserver-xorg-video-nvidia-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking xserver-xorg-video-nvidia-450-server (450.51.06-0ubuntu0.20.04.2) ...
Selecting previously unselected package nvidia-driver-450-server.
Preparing to unpack .../20-nvidia-driver-450-server_450.51.06-0ubuntu0.20.04.2_amd64.deb ...
Unpacking nvidia-driver-450-server (450.51.06-0ubuntu0.20.04.2) ...
Errors were encountered while processing:
 /tmp/apt-dpkg-install-khqbUA/01-libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

还:

$ sudo dpkg --configure -a
[sudo] password for mona: 
Setting up libnvidia-extra-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
dpkg: dependency problems prevent configuration of libnvidia-gl-450-server:amd64:
 libnvidia-gl-450-server:amd64 depends on libnvidia-common-450-server; however:
  Package libnvidia-common-450-server is not installed.

dpkg: error processing package libnvidia-gl-450-server:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-gl-450-server:i386:
 libnvidia-gl-450-server:i386 depends on libnvidia-common-450-server; however:
  Package libnvidia-common-450-server is not installed.

dpkg: error processing package libnvidia-gl-450-server:i386 (--configure):
 dependency problems - leaving unconfigured
Setting up libnvidia-compute-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-compute-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Setting up nvidia-kernel-source-450-server (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-cfg1-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Setting up nvidia-compute-utils-450-server (450.51.06-0ubuntu0.20.04.2) ...
Warning: The home dir /nonexistent you specified can't be accessed: No such file or directory
Adding system user `nvidia-persistenced' (UID 126) ...
Adding new group `nvidia-persistenced' (GID 133) ...
Adding new user `nvidia-persistenced' (UID 126) with group `nvidia-persistenced' ...
Not creating home directory `/nonexistent'.
dpkg: dependency problems prevent configuration of libnvidia-ifr1-450-server:amd64:
 libnvidia-ifr1-450-server:amd64 depends on libnvidia-gl-450-server; however:
  Package libnvidia-gl-450-server:amd64 is not configured yet.

dpkg: error processing package libnvidia-ifr1-450-server:amd64 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-ifr1-450-server:i386:
 libnvidia-ifr1-450-server:i386 depends on libnvidia-gl-450-server; however:
  Package libnvidia-gl-450-server:i386 is not configured yet.

dpkg: error processing package libnvidia-ifr1-450-server:i386 (--configure):
 dependency problems - leaving unconfigured
Setting up nvidia-utils-450-server (450.51.06-0ubuntu0.20.04.2) ...
Setting up xserver-xorg-video-nvidia-450-server (450.51.06-0ubuntu0.20.04.2) ...
dpkg: dependency problems prevent configuration of nvidia-driver-450-server:
 nvidia-driver-450-server depends on libnvidia-gl-450-server (= 450.51.06-0ubuntu0.20.04.2); however:
  Package libnvidia-gl-450-server:amd64 is not configured yet.
 nvidia-driver-450-server depends on libnvidia-ifr1-450-server (= 450.51.06-0ubuntu0.20.04.2); however:
  Package libnvidia-ifr1-450-server:amd64 is not configured yet.

dpkg: error processing package nvidia-driver-450-server (--configure):
 dependency problems - leaving unconfigured
Setting up nvidia-kernel-common-450-server (450.51.06-0ubuntu0.20.04.2) ...
update-initramfs: deferring update (trigger activated)
Setting up libnvidia-decode-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-decode-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-fbc1-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-fbc1-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Setting up nvidia-dkms-450-server (450.51.06-0ubuntu0.20.04.2) ...
update-initramfs: deferring update (trigger activated)
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
Loading new nvidia-450.51.06 DKMS files...
Building for 5.4.0-48-generic
Building for architecture x86_64
Building initial module for 5.4.0-48-generic
Secure Boot not enabled on this system.
Done.

nvidia.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-48-generic/updates/dkms/

nvidia-modeset.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-48-generic/updates/dkms/

nvidia-drm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-48-generic/updates/dkms/

nvidia-uvm.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.4.0-48-generic/updates/dkms/

depmod........

DKMS: install completed.
Setting up libnvidia-encode-450-server:amd64 (450.51.06-0ubuntu0.20.04.2) ...
Setting up libnvidia-encode-450-server:i386 (450.51.06-0ubuntu0.20.04.2) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for initramfs-tools (0.136ubuntu6.3) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-48-generic
Errors were encountered while processing:
 libnvidia-gl-450-server:amd64
 libnvidia-gl-450-server:i386
 libnvidia-ifr1-450-server:amd64
 libnvidia-ifr1-450-server:i386
 nvidia-driver-450-server
(base) mona@mona:~/Downloads$ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  cuda-command-line-tools-10-1 cuda-compiler-10-1 cuda-cudart-10-1 cuda-cudart-dev-10-1 cuda-cufft-10-1 cuda-cufft-dev-10-1 cuda-cuobjdump-10-1 cuda-cupti-10-1
  cuda-curand-10-1 cuda-curand-dev-10-1 cuda-cusolver-10-1 cuda-cusolver-dev-10-1 cuda-cusparse-10-1 cuda-cusparse-dev-10-1 cuda-driver-dev-10-1 cuda-gdb-10-1
  cuda-gpu-library-advisor-10-1 cuda-license-10-1 cuda-license-10-2 cuda-memcheck-10-1 cuda-misc-headers-10-1 cuda-npp-10-1 cuda-npp-dev-10-1 cuda-nsight-10-1
  cuda-nsight-compute-10-1 cuda-nsight-systems-10-1 cuda-nvcc-10-1 cuda-nvdisasm-10-1 cuda-nvgraph-10-1 cuda-nvgraph-dev-10-1 cuda-nvjpeg-10-1 cuda-nvjpeg-dev-10-1
  cuda-nvml-dev-10-1 cuda-nvprof-10-1 cuda-nvprune-10-1 cuda-nvrtc-10-1 cuda-nvrtc-dev-10-1 cuda-nvtx-10-1 cuda-nvvp-10-1 cuda-sanitizer-api-10-1 freeglut3
  freeglut3-dev libfprint-2-tod1 libglu1-mesa-dev libice-dev libllvm9 libllvm9:i386 libnvidia-common-440 libnvidia-common-450 libsm-dev libxext-dev libxfixes-dev
  libxi-dev libxmu-dev libxmu-headers libxt-dev nvidia-modprobe python3-click python3-colorama x11proto-input-dev x11proto-xext-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-common-450-server
The following NEW packages will be installed:
  libnvidia-common-450-server
0 upgraded, 1 newly installed, 0 to remove and 55 not upgraded.
5 not fully installed or removed.
Need to get 0 B/8,772 B of archives.
After this operation, 34.8 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 224697 files and directories currently installed.)
Preparing to unpack .../libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb ...
Unpacking libnvidia-common-450-server (450.51.06-0ubuntu0.20.04.2) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb (--unpack):
 trying to overwrite '/usr/share/nvidia/nvidia-application-profiles-450.51.06-key-documentation', which is also in package libnvidia-common-450 450.51.06-0ubuntu1
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-common-450-server_450.51.06-0ubuntu0.20.04.2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的来源.list:

$ cat /etc/apt/sources.list
# deb cdrom:[Ubuntu 20.04 LTS _Focal Fossa_ - Release amd64 (20200423)]/ focal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal universe
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner

deb http://security.ubuntu.com/ubuntu focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
# deb-src http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu focal-security multiverse

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.

此外,来自sources.list.d:

(base) mona@mona:~/Downloads$ ls /etc/apt/sources.list.d
total 44K
drwxr-xr-x 7 root root 4.0K Sep 19 22:01 ..
-rw-r--r-- 1 root root 1.2K Sep 23 21:00 teamviewer.list.save
-rw-r--r-- 1 root root   92 Sep 23 21:00 nvidia-machine-learning.list.save
-rw-r--r-- 1 root root  189 Sep 23 21:00 google-chrome.list.save
-rw-r--r-- 1 root root   80 Sep 23 21:00 cuda.list.save
drwxr-xr-x 2 root root 4.0K Sep 23 21:00 .
-rw-r--r-- 1 root root 1.2K Sep 23 21:00 teamviewer.list
-rw-r--r-- 1 root root   92 Sep 23 21:00 nvidia-machine-learning.list
-rw-r--r-- 1 root root  142 Sep 23 21:00 graphics-drivers-ubuntu-ppa-focal.list
-rw-r--r-- 1 root root  189 Sep 23 21:00 google-chrome.list
-rw-r--r-- 1 root root   80 Sep 23 21:00 cuda.list
(base) mona@mona:~/Downloads$ cat /etc/apt/sources.list.d/cuda.list
deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /
(base) mona@mona:~/Downloads$ cat /etc/apt/sources.list.d/cuda.list.save 
deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /
(base) mona@mona:~/Downloads$ cat /etc/apt/sources.list.d/nvidia-machine-learning.list
deb http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /
(base) mona@mona:~/Downloads$ cat /etc/apt/sources.list.d/graphics-drivers-ubuntu-ppa-focal.list 
deb http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal main
# deb-src http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu focal main
drivers dpkg nvidia apt 20.04
  • 1 个回答
  • 1853 Views
Martin Hope
Mona Jalal
Asked: 2020-07-31 08:50:51 +0800 CST

如何检查图像是否每个像素有 2 个字节以及如何将其转换为每个像素有 1 个字节的图像?

  • 2

我有来自 FLIR 相机的热图像,每个像素有 2 个字节。如果这些图像每个像素有 2 个字节,我不确定如何检查 Ubuntu。

另外,如何将每像素 2 字节的图像转换为每像素 1 字节的图像?

$ exiv2 frame0171.tiff
File name       : frame0171.tiff
File size       : 4194510 Bytes
MIME type       : image/tiff
Image size      : 1024 x 1024
Camera make     : 
Camera model    : 
Image timestamp : 
Image number    : 
Exposure time   : 
Aperture        : 
Exposure bias   : 
Flash           : 
Flash bias      : 
Focal length    : 
Subject distance: 
ISO speed       : 
Exposure mode   : 
Metering mode   : 
Macro mode      : 
Image quality   : 
Exif Resolution : 1024 x 1024
White balance   : 
Thumbnail       : None
Copyright       : 
Exif comment    : 


$ file frame0171.tiff
frame0171.tiff: TIFF image data, little-endian, direntries=14, height=1024, bps=182, compression=none, PhotometricIntepretation=RGB, width=1024


$ exiv2 Rec-000026_16bit_counts.tif
File name       : Rec-000026_16bit_counts.tif
File size       : 2097433 Bytes
MIME type       : 
Image size      : 0 x 0
Rec-000026_16bit_counts.tif: No Exif data found in the file

$ file Rec-000026_16bit_counts.tif
Rec-000026_16bit_counts.tif: Big TIFF image data, little-endian


$ exiv2 Rec-000026_tiff.tif
File name       : Rec-000026_tiff.tif
File size       : 1816013 Bytes
MIME type       : image/tiff
Image size      : 778 x 778
Camera make     : 
Camera model    : 
Image timestamp : 
Image number    : 
Exposure time   : 
Aperture        : 
Exposure bias   : 
Flash           : 
Flash bias      : 
Focal length    : 
Subject distance: 
ISO speed       : 
Exposure mode   : 
Metering mode   : 
Macro mode      : 
Image quality   : 
Exif Resolution : 778 x 778
White balance   : 
Thumbnail       : None
Copyright       : 
Exif comment    : 

$ file Rec-000026_tiff.tif
Rec-000026_tiff.tif: TIFF image data, little-endian
image-processing display-resolution conversion imagemagick
  • 1 个回答
  • 149 Views
Martin Hope
Mona Jalal
Asked: 2020-07-29 16:41:40 +0800 CST

为什么 Ubuntu 20.04 中的一些 GUI 字体如此之小?我该如何修复它们?

  • 8

我通过大学许可证安装了 MATLAB 2020,发现字体特别小。此外,在启动 Ubuntu 时,我的密码会打开一个 GUI,这个密码也非常小。我在 Ubuntu 20.04 中使用的其他 GUI 窗口没有这个问题。是什么原因,我该如何解决?

专门用于 MATLAB。

在此处输入图像描述

gui fonts matlab
  • 2 个回答
  • 2388 Views
Martin Hope
Mona Jalal
Asked: 2019-11-11 18:06:47 +0800 CST

如何找到 txt 文件中使用的分隔符并将其转换为逗号分隔的 csv?

  • 5

我有一个带有制表符或空格分隔符的 txt 文件。我需要将其转换为 csv。你如何建议使用命令行这样做?

$ perl -F"//" -nlae 'for (@F) {$a{$_}++};for (keys %a){print $_ if ($a{$_}+1==5 && !($_=~/\w/))};undef %a' moth_gt.txt

上面的命令什么也没输出。

该文件如下所示:

$ head -10 moth_gt.txt 
1.0000  494.5551  234.2510  711.6219  274.2668  481.7198  299.5598  311.0864  339.5756
2.0000  494.6552  233.6892  698.5310  237.2043  478.3979  300.0367  285.5068  300.0367
3.0000  496.0657  234.5680  660.4773  182.6485  477.8938  299.0346  279.7346  239.3273
4.0000  498.0948  236.4126  618.2942  142.6347  477.2553  302.2803  298.6309  175.0104
5.0000  499.2109  237.2335  603.7807  120.0112  473.9058  307.5669  323.1914  136.0130
6.0000  497.2581  236.8611  616.7132  115.5453  473.4415  309.7994  336.1240  123.7323
7.0000  497.2588  237.2343  642.7633  126.7104  471.5815  313.1497  329.7984  132.6645
8.0000  499.1200  239.4676  669.9296  159.0866  470.0935  315.7552  312.3086  156.4817
9.0000  498.0675  237.7640  703.4297  201.8367  468.7934  317.1588  292.7054  184.0948
10.0000  498.9722  237.7636  718.0843  248.8523  469.6981  316.7149  282.5214  219.1346

使用以下命令也无济于事:

$ cat moth_gt.csv | tr "\\t" "," >  moth_comma.csv
command-line bash format-conversion csv
  • 1 个回答
  • 4557 Views
Martin Hope
Mona Jalal
Asked: 2019-11-11 10:19:19 +0800 CST

文件名的零填充

  • 0

我想对文件名进行零填充。如果不是所有图像都存在,如 1.JPEG 不存在或 99.JPEG 或 110.JPEG ,我该怎么办?

 $ for n in $(seq 9); do mv $n.JPEG 0$n.JPEG; done; mv: cannot stat ‘1.JPEG’: No such file or directory

我不想手动重命名,因为视频的顺序很重要。

command-line mv
  • 2 个回答
  • 521 Views
Martin Hope
Mona Jalal
Asked: 2019-10-23 16:15:32 +0800 CST

将文件夹中的所有png文件转换为视频

  • 2

我有大约 450 帧,名为 1...450。但是,有一些丢失的帧,例如第 10 帧、第 30 帧等不存在。

我想以与 1...450.png 相同的顺序创建一个 AVI 视频。我该怎么做?

video ffmpeg convert png avi
  • 1 个回答
  • 9093 Views
Martin Hope
Mona Jalal
Asked: 2018-11-10 10:06:45 +0800 CST

将 1 通道图像转换为 3 通道图像

  • 4

我有一个只有 1 个通道的灰度图像。我正在使用一个期望所有图像都具有三个通道的代码。如何使用一些 Linux 命令将我的图像转换为 3 通道图像?

这是我得到的错误,我不想更改代码,而是想更改图像:

Traceback (most recent call last):
  File "get_img_vec.py", line 22, in <module>
    nd_arr = img2vec.get_vec(img)
  File "../img_to_vec.py", line 43, in get_vec
    h_x = self.model(image)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/models/resnet.py", line 139, in forward
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 1, 224, 224] to have 3 channels, but got 1 channels instead

图片:

$ identify 10524.jpg
0524.jpg JPEG 1050x550 1050x550+0+0 8-bit PseudoClass 256c 80.7KB 0.000u 0:00.000

这是图像:

一张脸的黑白照片

image-processing convert
  • 2 个回答
  • 20649 Views
Martin Hope
Mona Jalal
Asked: 2018-10-19 18:15:17 +0800 CST

从文件夹中的所有 jpg 图像中删除 alpha 通道

  • 2

如何自动从 jpg 图像中删除 alpha 通道?

我正在使用基于 PyTorch 的深度学习代码,它需要 3 个通道,但我的图像有 4 个通道。我看到了这个答案,但我不知道如何将文件夹中的所有图像转换为没有 alpha 通道的对应图像。

这是我收到的错误:

[jalal@goku example]$ python img_to_vec_nearest_neighbors.py 
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/transforms/transforms.py:188: UserWarning: The use of the transforms.Scale transform is deprecated, please use transforms.Resize instead.
Traceback (most recent call last):
  File "img_to_vec_nearest_neighbors.py", line 18, in <module>
    vec = img2vec.get_vec(img)
  File "../img_to_vec.py", line 43, in get_vec
    h_x = self.model(image)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torchvision-0.2.1-py3.6.egg/torchvision/models/resnet.py", line 139, in forward
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 477, in __call__
    result = self.forward(*input, **kwargs)
  File "/scratch/sjn-p3/anaconda/anaconda3/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
    self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 4, 224, 224] to have 3 channels, but got 4 channels instead

例如,如何对一个文件夹中的所有图像执行以下命令?我的图像具有 jpg、jpeg 和 png 扩展名,但我不介意它们是否都变成 jpg。

convert cat.png -background white -alpha remove cat.jpg
command-line image-processing imagemagick mogrify png
  • 1 个回答
  • 1927 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve