I wanted to load and plot images with masks on detectron2. But during loading, it throws me such error:
6 for s in random.sample(dataset_custom, n):
7 img = cv2.imread(s['file_name'])
----> 8 v = Visualizer(img[:,:,::-1], metadata = dataset_custom_metadata, scale = 0.5)
9 v = v.draw_dataset_dict(s)
10 #plt.figure(figsize = (15, 20))
TypeError: 'NoneType' object is not subscriptable
add Codeadd Markdown
Also, I got such error in colab and kaggle notebooks. In my local jupyter, I did not get this error. What to do to get rid of TypeError? Can I leave this step and do not use Visualizer or is it needed during segmentation?