hyseob / PyMDNet

MDNet PyTorch implementation
Other
421 stars 150 forks source link

PyTorch, plt.Axes function not work. #17

Open wangtenghong opened 6 years ago

wangtenghong commented 6 years ago

My PC spec. as follows. Hardware: Xeon-E3 / 16G / GTX 650 / Software: Ubuntu 16.04 / Anaconda 5.2(Python 2.7) / CUDA 9.0 / PyTorch 0.3.0

After I modified the size of opts['batch_test'] = 32 I can run following command.

$ python run_tracker.py -s DragonBaby

But when I want go further to do this:

$ python run_tracking.py -s DragonBaby -d -f

I got this information.

../modules/model.py:144: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument. pos_loss = -F.log_softmax(pos_score)[:,1] ../modules/model.py:145: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument. neg_loss = -F.log_softmax(neg_score)[:,0] Traceback (most recent call last): File "run_tracker.py", line 329, in result, result_bb, fps = run_mdnet(img_list, init_bbox, gt=gt, savefig_dir=savefig_dir, display=display) File "run_tracker.py", line 190, in run_mdnet im = ax.imshow(image, aspect='normal') File "/home/thwang/anaconda2/lib/python2.7/site-packages/matplotlib/init.py", line 1855, in inner return func(ax, *args, **kwargs) File "/home/thwang/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_axes.py", line 5482, in imshow self.set_aspect(aspect) File "/home/thwang/anaconda2/lib/python2.7/site-packages/matplotlib/axes/_base.py", line 1345, in set_aspect aspect = float(aspect) # raise ValueError if necessary ValueError: could not convert string to float: normal

I can't make this work properly. Could you help me solve this?

yiling-chen commented 5 years ago

Hi, @wangtenghong

I ran into the same problem and tried to downgrade matplotlib to 1.5.1, and it now work for me. Hope that will help.

wangtenghong commented 5 years ago

Thanks @yiling-chen . Nice to hear the solution, but I am not working with this code for a while. Maybe later on I will turn back. Then I will remember to downgrade the version of matplotlib.

TouchSkyWf commented 5 years ago

@yiling-chen Sorry,how to downgrade matplotlib? My matplotlib version is 2.1.2
Is there other ways to solve this problem?

RohitKeshari commented 5 years ago

@TouchSkyWf you can use anaconda-navigator to downgrade or upgrade any packages. However, this problem can be fixed by doing im = ax.imshow(image, aspect='auto') or im = ax.imshow(image) in place of im = ax.imshow(image, aspect='normal')