pip install torch==1.10.0+cu111 torchvision==0.11.0+cu113 torchaudio==0.10.0 -f https://download.pytorch.org/whl/torch_stable.html
pip install setuptools==59.5.0
https://youyuanbuzhi.com/clashx/dd7695b8-1ba0-4c39-b639-06a2b404f821
新旧torch修改=================================================
(qqn) nvidia@nvidia-desktop:~$ unset http_proxy (qqn) nvidia@nvidia-desktop:~$ unset https_proxy @article{guo2022segnext, title={Segnext: Rethinking convolutional attention design for semantic segmentation}, author={Guo, Meng-Hao and Lu, Cheng-Ze and Hou, Qibin and Liu, Zhengning and Cheng, Ming-Ming and Hu, Shi-Min}, journal={Advances in Neural Information Processing Systems}, volume={35}, pages={1140--1156}, year={2022} }
pip install torch==1.7.0+cu110 torchvision==0.8.1+cu110 torchaudio==0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
/home/user/disk1/user/anaconda3/envs/omni/bin/python /home/user/tapir_2022_10_19/pycharm-community-2021.1.2/plugins/python-ce/helpers/pydev/pydevd.py --multiproc --qt-support=auto --client 127.0.0.1 --port 35291 --file /home/user/disk1/user/omnimotion/train.py
Connected to pydev debugger (build 211.7442.45)
Backend TkAgg is interactive backend. Turning interactive mode on.
optimizing for tennis...
output is saved in out/default_tennis
No ckpts found, from scratch...
Traceback (most recent call last):
File "/home/user/tapir_2022_10_19/pycharm-community-2021.1.2/plugins/python-ce/helpers/pydev/pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "/home/user/tapir_2022_10_19/pycharm-community-2021.1.2/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "/home/user/disk1/user/omnimotion/train.py", line 113, in <module>
train(args)
File "/home/user/disk1/user/omnimotion/train.py", line 84, in train
trainer.train_one_step(step, batch)
File "/home/user/disk1/user/omnimotion/trainer.py", line 540, in train_one_step
loss, flow_data = self.compute_all_losses(batch,
File "/home/user/disk1/user/omnimotion/trainer.py", line 447, in compute_all_losses
out = self.get_blending_weights(x1s_canonical_samples)
File "/home/user/disk1/user/omnimotion/trainer.py", line 256, in get_blending_weights
color, density = self.get_canonical_color_and_density(x_canonical)
File "/home/user/disk1/user/omnimotion/trainer.py", line 245, in get_canonical_color_and_density
out_canonical = self.color_mlp(x_canonical)
File "/home/user/disk1/user/anaconda3/envs/omni/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/disk1/user/anaconda3/envs/omni/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 619, in forward
output = self.module(*inputs[0], **kwargs[0])
File "/home/user/disk1/user/anaconda3/envs/omni/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/disk1/user/omnimotion/networks/mfn.py", line 40, in forward
out = self.filters[i](x) * self.linear[i - 1](out)
File "/home/user/disk1/user/anaconda3/envs/omni/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
result = self.forward(*input, **kwargs)
File "/home/user/disk1/user/omnimotion/networks/mfn.py", line 110, in forward
return torch.sin(self.linear(x)) * torch.exp(-0.5 * D * self.gamma[None, :])
RuntimeError: CUDA out of memory. Tried to allocate 128.00 MiB (GPU 0; 10.76 GiB total capacity; 8.45 GiB already allocated; 92.12 MiB free; 8.47 GiB reserved in total by PyTorch)
python-BaseException
Process finished with exit code 1
import torch
import torch.nn as nn
# 定义回归神经网络模型
class RegressionNet(nn.Module):
def __init__(self, input_size, hidden_size):
super(RegressionNet, self).__init__()
self.fc1 = nn.Linear(input_size, hidden_size) # 输入层到隐藏层
self.relu = nn.ReLU() # 隐藏层的激活函数
self.fc2 = nn.Linear(hidden_size, 1) # 隐藏层到输出层,输出1维
def forward(self, x):
x = self.fc1(x)
x = self.relu(x)
x = self.fc2(x)
return x
# 创建模型实例,指定输入维度和隐藏层维度
input_size = 2 # 输入向量维度
hidden_size = 32 # 隐藏层维度
model = RegressionNet(input_size, hidden_size)
# 打印模型的结构
print(model)