amdegroot / ssd.pytorch

A PyTorch Implementation of Single Shot MultiBox Detector
MIT License
5.15k stars 1.75k forks source link

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

Open 237014845 opened 6 years ago

237014845 commented 6 years ago

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 commented 6 years ago

train on COCO dataset

ankitksharma commented 6 years ago

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

237014845 commented 6 years ago

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

liuchang8am commented 6 years ago

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 commented 6 years ago

@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 commented 6 years ago

anyone solve the problem?

salt-fisher commented 6 years ago

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

chensonglu commented 5 years ago

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

BerryLJ commented 5 years ago

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 commented 5 years ago

i'm getting the same error with COCO set.

SalahAdDin commented 5 years ago

@d-li14 https://github.com/d-li14/ssd.pytorch/commit/36fc354a0aed372d1f835efa7ad5684c5ee13daf It is working for me, at least until now. What's about making a PR?

Monster-Zhang commented 4 years ago

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

decoli commented 4 years ago

@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!!