sanchit2843 / Videoclassification

Crime detection in cctv footage using deep learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TrainData

jaycelol10 opened this issue · comments

iam using cuda with single gpu , first i did the same like you and that error show up

--- Epoch 0 ---

--- Phase train ---

BrokenPipeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_7520/1387622654.py in
14 print(f"--- Phase {phase} ---")
15 epoch_metrics = {"loss": [], "acc": []}
---> 16 for batch_i, (X, y) in enumerate(dataloaders[phase]):
17 print()
18 #iteration = iteration+1

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py in iter(self)
357 return self._iterator
358 else:
--> 359 return self._get_iterator()
360
361 @Property

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py in _get_iterator(self)
303 else:
304 self.check_worker_number_rationality()
--> 305 return _MultiProcessingDataLoaderIter(self)
306
307 @Property

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py in init(self, loader)
916 # before it starts, and del tries to join but will get:
917 # AssertionError: can only join a started process.
--> 918 w.start()
919 self._index_queues.append(index_queue)
920 self._workers.append(w)

~\AppData\Local\Programs\Python\Python37\lib\multiprocessing\process.py in start(self)
110 'daemonic processes are not allowed to have children'
111 _cleanup()
--> 112 self._popen = self._Popen(self)
113 self._sentinel = self._popen.sentinel
114 # Avoid a refcycle if the target function holds an indirect

~\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py in _Popen(process_obj)
221 @staticmethod
222 def _Popen(process_obj):
--> 223 return _default_context.get_context().Process._Popen(process_obj)
224
225 class DefaultContext(BaseContext):

~\AppData\Local\Programs\Python\Python37\lib\multiprocessing\context.py in _Popen(process_obj)
320 def _Popen(process_obj):
321 from .popen_spawn_win32 import Popen
--> 322 return Popen(process_obj)
323
324 class SpawnContext(BaseContext):

~\AppData\Local\Programs\Python\Python37\lib\multiprocessing\popen_spawn_win32.py in init(self, process_obj)
63 try:
64 reduction.dump(prep_data, to_child)
---> 65 reduction.dump(process_obj, to_child)
66 finally:
67 set_spawning_popen(None)

~\AppData\Local\Programs\Python\Python37\lib\multiprocessing\reduction.py in dump(obj, file, protocol)
58 def dump(obj, file, protocol=None):
59 '''Replacement for pickle.dump() using ForkingPickler.'''
---> 60 ForkingPickler(file, protocol).dump(obj)
61
62 #

BrokenPipeError: [Errno 32] Broken pipe

Then i have removerd Num_worker = 4 from train_loader and this error show up , can u please help me ?

--- Epoch 0 ---

--- Phase train ---

TypeError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_7520/1651256458.py in
14 print(f"--- Phase {phase} ---")
15 epoch_metrics = {"loss": [], "acc": []}
---> 16 for batch_i, (X, y) in enumerate(dataloaders[phase]):
17 print("available")
18 #iteration = iteration+1

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py in next(self)
519 if self._sampler_iter is None:
520 self._reset()
--> 521 data = self._next_data()
522 self._num_yielded += 1
523 if self._dataset_kind == _DatasetKind.Iterable and \

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data\dataloader.py in _next_data(self)
559 def _next_data(self):
560 index = self._next_index() # may raise StopIteration
--> 561 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
562 if self._pin_memory:
563 data = _utils.pin_memory.pin_memory(data)

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py in fetch(self, possibly_batched_index)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]

~\AppData\Local\Programs\Python\Python37\lib\site-packages\torch\utils\data_utils\fetch.py in (.0)
42 def fetch(self, possibly_batched_index):
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:
46 data = self.dataset[possibly_batched_index]

~\AppData\Local\Temp/ipykernel_7520/3273416116.py in getitem(self, idx)
11 seq_img = list()
12 for i in range(16):
---> 13 img1 = img[:,128i:128(i+1),:]
14 if(self.transform):
15 img1 = self.transform(img1)

TypeError: 'NoneType' object is not subscriptable

Hello, the code is very old and most of the stuff is probably deprecated, you can use this code as reference to write your own code, but I would suggest you to use some other repository.

@jaycelol10 Did your error get solved. If it did please let me know the solution.