Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Must define a window to update? why? #234

Open
237014845 opened this issue Sep 11, 2018 · 13 comments
Open

AssertionError: Must define a window to update? why? #234

237014845 opened this issue Sep 11, 2018 · 13 comments

Comments

@237014845
Copy link

iter 2360 || Loss: 9.8369 || timer: 0.5007 sec.
iter 2370 || Loss: 9.9223 || timer: 0.4940 sec.
iter 2380 || Loss: 11.2484 || timer: 0.4787 sec.
iter 2390 || Loss: 10.6926 || timer: 0.4976 sec.
iter 2400 || Loss: 9.6664 || timer: 0.4990 sec.
iter 2410 || Loss: 10.5185 || timer: 0.5092 sec.
iter 2420 || Loss: 12.2446 || timer: 0.5129 sec.
iter 2430 || Loss: 12.2896 || timer: 0.4818 sec.
iter 2440 || Loss: 10.2730 || timer: 0.4859 sec.
iter 2450 || Loss: 10.4930 || timer: 0.5135 sec.
iter 2460 || Loss: 9.9998 || timer: 0.5068 sec.
iter 2470 || Loss: 11.2983 || timer: 0.5139 sec.
iter 2480 || Loss: 10.9896 || timer: 0.4783 sec.
iter 2490 || Loss: 9.8864 || timer: 0.5100 sec.
iter 2500 || Loss: 10.8051 || timer: 0.4982 sec.
iter 2510 || Loss: 10.4417 || timer: 0.4783 sec.
iter 2520 || Loss: 10.2917 || timer: 0.4758 sec.
iter 2530 || Loss: 10.9877 || timer: 0.4810 sec.
iter 2540 || Loss: 10.6649 || timer: 0.4757 sec.
iter 2550 || Loss: 10.9075 || timer: 0.4899 sec.
iter 2560 || Loss: 11.8318 || Traceback (most recent call last):
File "train.py", line 266, in
train()
File "train.py", line 159, in train
'append', epoch_size)
File "train.py", line 261, in update_vis_plot
update=True
File "/home/hs/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 288, in wrapped_f
return f(*args, **kwargs)
File "/home/hs/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 1207, in line
update=update, name=name)
File "/home/hs/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 288, in wrapped_f
return f(*args, **kwargs)
File "/home/hs/anaconda3/lib/python3.6/site-packages/visdom/init.py", line 1010, in scatter
assert win is not None, 'Must define a window to update'
AssertionError: Must define a window to update

@237014845
Copy link
Author

train on COCO dataset

@ankitksharma
Copy link

I'm getting the error on COCO dataset also. Any solution?

@237014845
Copy link
Author

line 163 update_vis_plot(epoch, loc_loss, conf_loss, iter_plot, epoch_plot, 'append', epoch_size)

@liuchang8am
Copy link

same error when training on VOC2007

File "train.py", line 257, in <module> train() File "train.py", line 156, in train 'append', viz, epoch_size) File "train.py", line 252, in update_vis_plot update=True File "/home/lc/anaconda3/envs/dl/lib/python3.5/site-packages/visdom/__init__.py", line 288, in wrapped_f return f(*args, **kwargs) File "/home/lc/anaconda3/envs/dl/lib/python3.5/site-packages/visdom/__init__.py", line 1207, in line update=update, name=name) File "/home/lc/anaconda3/envs/dl/lib/python3.5/site-packages/visdom/__init__.py", line 288, in wrapped_f return f(*args, **kwargs) File "/home/lc/anaconda3/envs/dl/lib/python3.5/site-packages/visdom/__init__.py", line 1010, in scatter assert win is not None, 'Must define a window to update' AssertionError: Must define a window to update

@d-li14
Copy link

d-li14 commented Oct 13, 2018

@237014845 hi, you solved the problem by modifying this line: update_vis_plot(epoch, loc_loss, conf_loss, iter_plot, epoch_plot, 'append', epoch_size)? In my opinion, the update_vis_plot function keeps updating parameter win1, i.e. iter_plot instead of the expected epoch_plot.
And I think through just moving the line epoch += 1 before update_vis_plot, this problem can be solved.

@chanajianyu
Copy link

anyone solve the problem?

@salt-fisher
Copy link

@chanajianyu I have faced the same problem, and adjust the code as your point. It works, thx

d-li14 added a commit to d-li14/ssd.pytorch that referenced this issue Nov 3, 2018
…ix bug amdegroot#234 for Visdom window display, remove redundant parameter in 'criterion', logging more info, fix PyTorch 0.4.0+ comatibility
@chensonglu
Copy link

@d-li14 According to your fix, it works, thx.

@BerryLJ
Copy link

BerryLJ commented Mar 16, 2019

iter 730 || Loss: 6.8846 || timer: 0.4548 sec.
iter 740 || Loss: 6.6700 || timer: 0.4608 sec.
iter 750 || Loss: 6.8756 || timer: 0.4498 sec.
iter 760 || Loss: 6.4595 || Traceback (most recent call last):
File "E:/ownstudy/ssd.pytorch-master/train.py", line 272, in
train()
File "E:/ownstudy/ssd.pytorch-master/train.py", line 164, in train
update_vis_plot(epoch, loc_loss, conf_loss, epoch_plot, None ,'append', epoch_size)
File "E:/ownstudy/ssd.pytorch-master/train.py", line 267, in update_vis_plot
update=update_type
File "C:\Users\Berry\Anaconda3\envs\pytorch\lib\site-packages\visdom_init_.py", line 335, in wrapped_f
return f(*args, **kwargs)
File "C:\Users\Berry\Anaconda3\envs\pytorch\lib\site-packages\visdom_init_.py", line 1367, in line
update=update, name=name)
File "C:\Users\Berry\Anaconda3\envs\pytorch\lib\site-packages\visdom_init_.py", line 335, in wrapped_f
return f(*args, **kwargs)
File "C:\Users\Berry\Anaconda3\envs\pytorch\lib\site-packages\visdom_init_.py", line 1144, in scatter
assert win is not None, 'Must define a window to update'
AssertionError: Must define a window to update

Process finished with exit code 1

Hello, does anyone know the reason? Thank you!

@SalahAdDin
Copy link

i'm getting the same error with COCO set.

@SalahAdDin
Copy link

SalahAdDin commented Jul 16, 2019

@d-li14
d-li14@36fc354 It is working for me, at least until now.
What's about making a PR?

SalahAdDin added a commit to SalahAdDin/ssd.pytorch that referenced this issue Jul 24, 2019
Modify model loading and saving path, set 'viz' as global variable, fix bug amdegroot#234 for Visdom window display, remove redundant parameter in 'criterion', logging more info, fix PyTorch 0.4.0+ compatibility.
@Monster-Zhang
Copy link

the num_class in config.py should +1 and in ssd.py are not

@decoli
Copy link

decoli commented Jun 14, 2020

@237014845 hi, you solved the problem by modifying this line: update_vis_plot(epoch, loc_loss, conf_loss, iter_plot, epoch_plot, 'append', epoch_size)? In my opinion, the update_vis_plot function keeps updating parameter win1, i.e. iter_plot instead of the expected epoch_plot.
And I think through just moving the line epoch += 1 before update_vis_plot, this problem can be solved.

It works,

if args.visdom and iteration != 0 and (iteration % epoch_size == 0):
    epoch += 1
    update_vis_plot(epoch, loc_loss, conf_loss, epoch_plot, None, 'append', epoch_size)

gooood!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests