Error running DLC on Colab after V2.1.6.2 update

Hi,
I tried to re-train my network after merging some training datasets on Google Colab. When I tried to run the training, I receive the following error, is it something to do with the latest python update or am I doing something wrong?

Initializing ResNet
Loading already trained DLC with backbone: resnet_50
INFO:tensorflow:Restoring parameters from ./snapshot-130000
Max_iters overwritten as 200000
Display_iters overwritten as 1000
Save_iters overwritten as 10000
Training parameter:
{‘stride’: 8.0, ‘weigh_part_predictions’: False, ‘weigh_negatives’: False, ‘fg_fraction’: 0.25, ‘weigh_only_present_joints’: False, ‘mean_pixel’: [123.68, 116.779, 103.939], ‘shuffle’: True, ‘snapshot_prefix’: ‘/content/drive/My Drive/Colab Notebooks/Indianus_freeflight-Ravi_Carlos-2020-02-05/dlc-models/iteration-1/Indianus_freeflightFeb5-trainset95shuffle0/train/snapshot’, ‘log_dir’: ‘log’, ‘global_scale’: 0.8, ‘location_refinement’: True, ‘locref_stdev’: 7.2801, ‘locref_loss_weight’: 0.05, ‘locref_huber_loss’: True, ‘optimizer’: ‘sgd’, ‘intermediate_supervision’: False, ‘intermediate_supervision_layer’: 12, ‘regularize’: False, ‘weight_decay’: 0.0001, ‘mirror’: False, ‘crop_pad’: 0, ‘scoremap_dir’: ‘test’, ‘batch_size’: 1, ‘dataset_type’: ‘default’, ‘deterministic’: False, ‘crop’: True, ‘cropratio’: 0.4, ‘minsize’: 100, ‘leftwidth’: 400, ‘rightwidth’: 400, ‘topheight’: 400, ‘bottomheight’: 400, ‘all_joints’: [[0]], ‘all_joints_names’: [‘bodypart1’], ‘dataset’: ‘training-datasets/iteration-1/UnaugmentedDataSet_Indianus_freeflightFeb5/Indianus_freeflight_Ravi_Carlos95shuffle0.mat’, ‘display_iters’: 1000, ‘init_weights’: ‘./snapshot-130000’, ‘max_input_size’: 1500, ‘metadataset’: ‘training-datasets/iteration-1/UnaugmentedDataSet_Indianus_freeflightFeb5/Documentation_data-Indianus_freeflight_95shuffle0.pickle’, ‘min_input_size’: 64, ‘multi_step’: [[0.005, 10000], [0.02, 430000], [0.002, 730000], [0.001, 1030000]], ‘net_type’: ‘resnet_50’, ‘num_joints’: 1, ‘pos_dist_thresh’: 17, ‘project_path’: ‘/content/drive/My Drive/Colab Notebooks/Indianus_freeflight-Ravi_Carlos-2020-02-05’, ‘save_iters’: 50000, ‘scale_jitter_lo’: 0.5, ‘scale_jitter_up’: 1.25, ‘output_stride’: 16, ‘deconvolutionstride’: 2}
Starting training…
Exception in thread Thread-6:
Traceback (most recent call last):
File “/usr/lib/python3.6/threading.py”, line 916, in _bootstrap_inner
self.run()
File “/usr/lib/python3.6/threading.py”, line 864, in run
self._target(*self._args, **self._kwargs)
File “/usr/local/lib/python3.6/dist-packages/deeplabcut/pose_estimation_tensorflow/train.py”, line 79, in load_and_enqueue
batch_np = dataset.next_batch()
File “/usr/local/lib/python3.6/dist-packages/deeplabcut/pose_estimation_tensorflow/dataset/pose_defaultdataset.py”, line 145, in next_batch
return self.make_batch(data_item, scale, mirror)
File “/usr/local/lib/python3.6/dist-packages/deeplabcut/pose_estimation_tensorflow/dataset/pose_defaultdataset.py”, line 165, in make_batch
image = imread(os.path.join(self.cfg.project_path,im_file), mode=‘RGB’)
File “/usr/local/lib/python3.6/dist-packages/deeplabcut/utils/auxfun_videos.py”, line 18, in imread
return cv2.cvtColor(cv2.imread(path), cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(3.4.9) /io/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function ‘cvtColor’

hi, I just ran COLAB w/2.1.6.2 and I have no issues; be sure you click “restart runtime” after you ran pip install deeplabcut - so maybe try that again. You can also run our DEMO project in <5 min to validate the code is working: https://github.com/AlexEMG/DeepLabCut/blob/master/examples/COLAB_DEMO_mouse_openfield.ipynb

1 Like