当前位置:网站首页>OSV_ q The size of tensor a (704) must match the size of tensor b (320) at non-singleton dime
OSV_ q The size of tensor a (704) must match the size of tensor b (320) at non-singleton dime
2022-07-28 22:45:00 【Claire_ Shang】
====>> Wed Mar 16 12:16:26 2022 Pass time: 0:02:06.581927
==>> save samples 13!
barbara
Load Data: barbara
====>> Build Net
====>> Load I model
====>> Train
torch.Size([1, 3, 544, 704]) torch.Size([1, 3, 544, 704])
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 410, in <module>
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 301, in train
lc_time = time.asctime(time.localtime(time.time()))
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 97, in loss_func
u11 = (f1 - dive1 + b2).to(torch.float32)
RuntimeError: The size of tensor a (704) must match the size of tensor b (320) at non-singleton dimension 3
Process finished with exit code 1
The image dimension should be wrong , Find the problem : The originally defined code fixes the image dimension
q1 = torch.zeros([1, 3, 320, 320])So it changes to the dimension of the input image , success
q1 = torch.zeros(f.shape)
q1 = q1.to(device)
b1 = b2 = q2 = q1It's already running , Enter the parameter adjustment process
do not know why , When I increase batch_size=5 after ( Turned out to be 1), Just report a mistake
====>> Train
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 395, in <module>
train(opt)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 295, in train
print(outstr + ' Loss = %f' % loss.data.cpu().numpy())
UnboundLocalError: local variable 'loss' referenced before assignment
Process finished with exit code 1Analyze local variables and global variables , Add this line outside the loop
loss = NoneBut there was an error
====>> Train
Traceback (most recent call last):
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 395, in <module>
train(opt)
File "C:/Users/shang/Desktop/STDN_LI/TVGnet/OSV_q.py", line 295, in train
print(outstr + ' Loss = %f' % loss.data.cpu().numpy())
AttributeError: 'NoneType' object has no attribute 'data'
Process finished with exit code 1
Not good either. , Don't change it yet batch_size Well , Try adjusting other parameters first
边栏推荐
- Evaluation index of anomaly detection: rocauc et al. [tips]
- winServer运维技术栈
- What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
- 【转载】token令牌在登录场景使用
- 微信小程序里button点击的时候会边框有黑线
- 20-09-27 the project is migrated to Alibaba toss record (the network card order makes the service unable to connect to DB through haproxy)
- Ngrok intranet penetration
- Stm32+ four pin OLED screen + Chinese character mold taking
- STM32 - external interrupt application (exti) (use cubemx to configure interrupts)
- MySQL command (add, delete, check and modify)
猜你喜欢

Att & CK preliminary understanding

STM32 - Communication

STM32 - Basic timer (tim6, tim7) working process, interpretation function block diagram, timing analysis, cycle calculation

STM32_ Hal library driven framework

How to install WiFi correctly

Summary of common error types in JS

PC side web page special effects (offset series, obtain the coordinates of the mouse in the box, pop-up drag effect, magnifying glass effect)

OSV_ q AttributeError: ‘numpy. ndarray‘ object has no attribute ‘clone‘

es个人整理的相关面试题

Vscode ROS configuration GDB debugging error record
随机推荐
Using nodejs to operate MySQL
C language to realize string reverse order arrangement
《结构学》介绍
【三维目标检测】3DSSD(二)
二进制的原码、反码、补码
How to use sprintf function
使用PCL批量显示PCD点云数据流
Padim [anomaly detection: embedded based]
PUA in the workplace, but it makes sense
SSH password free login
Labelme labels circular objects [tips]
Concise history of graphic technology
npm ERR code ETIMEDOUT npm ERR syscall connect npm ERR errno ETIMEDOUT npm ERR network reques...
Awk blank line filtering
[connect set-top box] - use ADB command line to connect ec6108v9 Huawei Yuehe box wirelessly
Summary of recent bugs
STM32 board level support package for keys
Intelligent control -- fuzzy mathematics and control
What to do after mathematical modeling gets the competition problem and some ("crooked ways") tips - must see before the competition
STM32 - memory, I2C protocol