但是训练train的时候报错
Traceback (most recent call last):
File "F:/pycharmprogram/mask-rcnn-tf2/train.py", line 296, in
callbacks = callbacks
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
return method(self, *args, kwargs)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\training.py", line 815, in fit
model=self)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1112, in init
model=model)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 908, in initkwargs)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 772, in init
peek, x = self._peek_and_restore(x)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 912, in _peek_and_restore
return x[0], x
File "F:\pycharmprogram\mask-rcnn-tf2\utils\dataloader.py", line 239, in getitem
image, boxes, mask_gt, num_crowds, image_id = self.pull_item(global_index)
File "F:\pycharmprogram\mask-rcnn-tf2\utils\dataloader.py", line 337, in pull_item
if len(boxes_classes) > 0:
UnboundLocalError: local variable 'boxes_classes' referenced before assignment
但是训练train的时候报错 Traceback (most recent call last): File "F:/pycharmprogram/mask-rcnn-tf2/train.py", line 296, in
callbacks = callbacks
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\training.py", line 66, in _method_wrapper
return method(self, *args, kwargs)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\training.py", line 815, in fit
model=self)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 1112, in init
model=model)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 908, in init
kwargs)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 772, in init
peek, x = self._peek_and_restore(x)
File "C:\Users\12396\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 912, in _peek_and_restore
return x[0], x
File "F:\pycharmprogram\mask-rcnn-tf2\utils\dataloader.py", line 239, in getitem
image, boxes, mask_gt, num_crowds, image_id = self.pull_item(global_index)
File "F:\pycharmprogram\mask-rcnn-tf2\utils\dataloader.py", line 337, in pull_item
if len(boxes_classes) > 0:
UnboundLocalError: local variable 'boxes_classes' referenced before assignment
进程已结束,退出代码1