alanlukezic / d3s

D3S - Discriminative Single Shot Segmentation Tracker (CVPR 2020)
265 stars 57 forks source link

'Segm' object has no attribute 'sequence_name' #6

Closed antdimarino closed 4 years ago

antdimarino commented 4 years ago

Hi, I tried to use D3S but I couldn't run it, I followed all the required steps and I found these errors.

First of all I downloaded the d3s repository with git clone in the cluster that I use. Then I installed the dependencies using the install.sh file. I set in the default_params.py file the path for the segmentation mask and the path for the pre-trained network.

I installed the vot-toolkit using this guide: https://www.votchallenge.net/howto/tutorial_python.html

I created the workspace itself inside the pytracking folder, downloading the vot2018 dataset.

in the evaluation folder I modified the file environment setting the path for the dataset generating the file local.py

I activated the conda environment pytracking I run the script with the command: python run_tracker.py segm default_params --dataset vot18 --sequence ball1 --debug 1

That's the mistake that detects me:

/home/antoniodimarino/.conda/envs/pytracking/lib/python3.7/site-packages/torch/nn/functional.py:2539: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  "See the documentation of nn.Upsample for details.".format(mode))
/home/antoniodimarino/.conda/envs/pytracking/lib/python3.7/site-packages/torch/nn/functional.py:2457: UserWarning: nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.
  warnings.warn("nn.functional.upsample is deprecated. Use nn.functional.interpolate instead.")
Traceback (most recent call last):
  File "run_tracker.py", line 84, in <module>
    main()
  File "run_tracker.py", line 80, in main
    run_tracker(args.tracker_name, args.tracker_param, args.runid, args.dataset, args.sequence, args.debug, args.threads)
  File "run_tracker.py", line 65, in run_tracker
    run_dataset(dataset, trackers, debug, threads)
  File "../pytracking/evaluation/running.py", line 54, in run_dataset
    run_sequence(seq, tracker_info, debug=debug)
  File "../pytracking/evaluation/running.py", line 21, in run_sequence
    tracked_bb, exec_times = tracker.run(seq, debug=debug)
  File "../pytracking/evaluation/tracker.py", line 58, in run
    output_bb, execution_times = tracker.track_sequence(seq)
  File "../pytracking/tracker/base/basetracker.py", line 35, in track_sequence
    self.initialize(image, sequence.init_state)
  File "../pytracking/tracker/segm/segm.py", line 163, in initialize
    self.init_segmentation(image, state, init_mask=init_mask)
  File "../pytracking/tracker/segm/segm.py", line 887, in init_segmentation
    self.params.masks_save_path, self.sequence_name, self.frame_name)
AttributeError:  'Segm' object has no attribute 'sequence_name'

How can I fix this mistake? Thank you very much

sherlockedlee commented 4 years ago

Because your params.masks_save_path is not empty.If you need to save the mask during tracking,you should set self.sequence_name and self.frame_name in tracker/base/basetracker.py,or else,you just set params.masks_save_path=''.

antdimarino commented 4 years ago

Problem solved thanks!