emrahbasaran / SPReID

Code for our CVPR 2018 paper - Human Semantic Parsing for Person Re-identification
MIT License
141 stars 32 forks source link

'map' object is not subscriptable #11

Open TJJTJJTJJ opened 6 years ago

TJJTJJTJJ commented 6 years ago

/home/zbp/Linux/tjj/SPReID/main.py(145)Train() 144 ipdb.set_trace() --> 145 tmp1 = batch_tuple_indx[iterk] 146 tmp2 = batch_tuples[dataset][batch_tuple_indx[iterk]]

ipdb> c Exception in thread prefetch_loop: multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "/home/zbp/anaconda3/lib/python3.6/multiprocessing/pool.py", line 119, in worker result = (True, func(*args, *kwds)) File "/home/zbp/anaconda3/lib/python3.6/multiprocessing/pool.py", line 44, in mapstar return list(map(args)) File "/home/zbp/anaconda3/lib/python3.6/site-packages/chainer/iterators/multiprocess_iterator.py", line 428, in _fetch_run data = _fetch_dataset[index] File "/home/zbp/anaconda3/lib/python3.6/site-packages/chainer/dataset/dataset_mixin.py", line 67, in getitem return self.get_example(index) File "/home/zbp/Linux/tjj/SPReID/datachef.py", line 32, in get_example fy = float(self.image_size[0]) / float(input_image.shape[0]) # Height TypeError: 'map' object is not subscriptable """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/zbp/anaconda3/lib/python3.6/threading.py", line 916, in _bootstrap_inner self.run() File "/home/zbp/anaconda3/lib/python3.6/threading.py", line 864, in run self._target(*self._args, **self._kwargs) File "/home/zbp/anaconda3/lib/python3.6/site-packages/chainer/iterators/multiprocess_iterator.py", line 336, in _run alive = self._task() File "/home/zbp/anaconda3/lib/python3.6/site-packages/chainer/iterators/multiprocess_iterator.py", line 355, in _task data_all = future.get(_response_time) File "/home/zbp/anaconda3/lib/python3.6/multiprocessing/pool.py", line 644, in get raise self._value TypeError: 'map' object is not subscriptable

Even I use x = self.pool.apply((x,))[0],it doesn't solve the problem. Thank you.

myknowntime commented 5 years ago

Hi, I also met the same problem, I just use "list(map(args))" instead of "map(args)" in main.py from line 233 to line 246. However, when it comes to line 124 iterator=MultiprocessIterator(DataChef.ReID10D(args,...image_size=image_size), args.minibatch, n_prefetch=2, n_processes=args.nb_processes, shared_mem=20000000,repeat=True,shuffle=True). This file can't continue. Could you tell me how to solve this problem? THX a lot. @TJJTJJTJJ

ajwl-pmli commented 4 years ago

Hello, Do you know how to compute the rank1 and mAP? could you give me the code which compute the rank1 and mAP, My mail is pku1401210454@163.com, Thank you very much! @myknowntime