当前位置:网站首页>OSV-q grd_ x=grd_ x[:, :, 0:-1, :]-data_ in[:, :, 1:, :]IndexError: too many indices for tensor of d
OSV-q grd_ x=grd_ x[:, :, 0:-1, :]-data_ in[:, :, 1:, :]IndexError: too many indices for tensor of d
2022-07-28 22:44:00 【Claire_ Shang】
input_net, target_net = Variable(batch[0]), Variable(batch[1], requires_grad=False) torch.Size([1, 3, 356, 356]) torch.Size([1, 3, 356, 356])
torch.Size([1, 3, 356, 356]) torch.Size([1, 3, 356, 356])
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 359, in <module>
train(opt)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 286, in train
grd_x, grd_y = getGrd(img_in)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 37, in getGrd
grd_x = grd_x[:, :, 0:-1, :] - data_in[:, :, 1:, :]
IndexError: too many indices for tensor of dimension 3
==>> Wed Mar 9 09:41:36 2022 [Iteration 1 Epoch 500] Loss = 12718.471680
==>> Wed Mar 9 09:41:36 2022 [Iter 1/8] loss = 12718.471680
====>> Wed Mar 9 09:41:36 2022 Pass time: 0:00:19.132388
Process finished with exit code 1Change to True
input_net, target_net = Variable(batch[0]), Variable(batch[1], requires_grad=True) torch.Size([1, 3, 356, 356]) torch.Size([1, 3, 356, 356])
==>> Wed Mar 9 09:27:59 2022 [Iteration 1 Epoch 500] Loss = 12005.107422
==>> Wed Mar 9 09:27:59 2022 [Iter 1/8] loss = 12005.107422
====>> Wed Mar 9 09:27:59 2022 Pass time: 0:00:20.932553
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 359, in <module>
train(opt)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 286, in train
grd_x, grd_y = getGrd(img_in)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 37, in getGrd
grd_x = grd_x[:, :, 0:-1, :] - data_in[:, :, 1:, :]
IndexError: too many indices for tensor of dimension 3
It seems different , But I don't know what's different
Decided to go from batch Functions are pushed up one by one
After trying many methods, I suddenly thought of a problem , Since it is all gradient function dimension error , The input image and network output dimensions are different , We define a new dimensional gradient function
Then this problem does not report an error, and the code goes forward one line , Bitter ......
==>> Wed Mar 9 11:11:56 2022 [Iter 1/8] loss = 8833.374023
====>> Wed Mar 9 11:11:56 2022 Pass time: 0:00:17.003332
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 361, in <module>
train(opt)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 289, in train
lap = -(cmul(fft2(grd_x), cconj(fft2(grd_x), inplace=False)) + cmul(fft2(grd_y), cconj(fft2(grd_y), inplace=False)))
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 138, in fft2
return torch.fft.fft2(t, 2)
AttributeError: 'builtin_function_or_method' object has no attribute 'fft2'
Process finished with exit code 1边栏推荐
- Awk blank line filtering
- GD32F303固件库开发(10)----双ADC轮询模式扫描多个通道
- 基于Ernie-3.0 CAIL2019法研杯要素识别多标签分类任务
- Research cup element recognition multi label classification task based on ernie-3.0 cail2019 method
- JVM -- custom class loader
- Ngrok intranet penetration
- DOM programming + events
- CS flow [abnormal detection: normalizing flow]
- JSON file to PNG image (batch conversion / image naming / migration / pixel value change) [tips]
- PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)
猜你喜欢

微信小程序剪切图片的功能

LVS+KeepAlived高可用部署实战应用
![Memseg [anomaly detection: embedded based]](/img/10/aea2b6ecf55e04fe24f78e5fb897be.png)
Memseg [anomaly detection: embedded based]

imx6q gpio复用

使用PCL批量将点云.bin文件转.pcd

winform跳转第二个窗体案例

STM32 single chip microcomputer drive L298N

STM32 - advanced control timer (time base unit, functional block diagram, input, capture, output, open circuit)

MySQL installation and configuration (super detailed, simple and practical)

c语言实现字符串逆序排列
随机推荐
LTE小区搜索过程及SCH/BCH设计
JS获取当前时间(年月日时分秒)
Wechat applet uses canvas drawing, round avatar, network background, text, dotted line, straight line
Qt+FFmpeg环境搭建
STM32 - reset and clock control (cubemx for clock configuration)
Excel-vba quick start (XIII. Common usage of date)
删除容器镜像报错解决image is referenced in multiple repositories
Analysis notes on let (const) temporary dead zone in JS
elment-plus图标input上面带的图标为什么不显示
105. Construct binary tree from preorder and inorder traversal sequence (medium binary tree DFS hash table binary tree)
NPM switch Taobao source (NPM source)
Summary of common error types in JS
Kali source solution software cannot be installed correctly
ngx+sql环境离线安装日志(rpm安装)
Use REM to make the font size adaptive to the screen
c语言实现字符串逆序排列
What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
LeetCode刷题系列之-多数之和类型
fatal error: io. h: No such file or directory
winform跳转第二个窗体案例