小编jga*_*uth的帖子

Pytorch 使用了太多资源

我正在使用 pytorch 来训练 DQN 模型。使用 ubuntu,如果我使用 htop,我会得到

在此处输入图片说明

正如你所看到的,所有资源都被使用了,我有点担心。这是我的代码

有没有办法使用更少的资源?我是否必须使用 pytorch 添加我的要求?

请注意,我的机器上没有 GPU,只有 CPU

ubuntu multithreading htop pytorch

5
推荐指数
1
解决办法
608
查看次数

防止 Google Colab 进程断开连接

假设我必须搬离我女朋友的公寓 3 小时,并且我正在运行 Colab 环境。我无法停止这个过程,我需要带上我的电脑。如何防止正在运行的进程断开连接?

我已经尝试过这个问题,但我认为 Google Colab 界面发生了一些变化,因此答案不再是最新的。

google-colaboratory

4
推荐指数
1
解决办法
8812
查看次数

Obtaining the shape (4, 1, 84, 84) with pytorch

Suppose I have four pytorch tensors (tensor1, tensor2, tensor3, tensor4). Each tensor is of shape (1, 1, 84, 84). The first dimension is the number of tensors, the second dimension is the number of colors (e.g. grayscale in our example) and the last two dimensions represent the height and the width of the image.

I want to stack them so that I get the shape (4, 1, 84, 84).

我试过了torch.stack((tensor1, tensor2, tensor3, tensor4), dim=0),但我得到了一个形状(4, …

python pytorch

2
推荐指数
1
解决办法
32
查看次数