ubuntu 通过xrdp建立远程桌面连接

首先安装桌面环境用于远程桌面。xfce是一个比较合适的桌面环境。

按照下面链接的步骤安装桌面环境与xrdp

https://www.itcoder.tech/posts/how-to-install-xrdp-on-ubuntu-18-04/

安装完成后,发现连接远程后,输入账号密码后会蓝屏,用下面链接的方法解决。安装非官方的xrdp,可能官方的xrdp是有问题的

https://askubuntu.com/questions/1166568/remote-desktop-blue-screen-after-login

sudo add-apt-repository ppa:martinx/xrdp-hwe-18.04
sudo apt-get update
sudo apt-get install xrdp xorgxrdp

pytorch统计模型计算量和参数量

利用thop库中的profile函数,可以实现统计pytorch模型的计算量和参数量。

import torch
from thop import profile

net = Net()     #net为pytorch的网络模型
input_ = torch.rand((1,2,512,512))  #随机初始化一个向量,用于网络输入
flops, params = profile(net, inputs = (input_,)) #得到计算量和参数量