I am making a script using the SDK to upload external pseudo labels as predictions to a Labelbox project. I am using this code to upload mask labels.
upload_job = MALPredictionImport.create_from_objects(
client=client,
project_id="XXXXXXXXXXX",
name="mal_job" + str(uuid.uuid4()),
predictions=Labels,
)
upload_job.wait_till_done(show_progress=True)
print("Errors:", upload_job.errors)
Labels is a List of <class ‘labelbox.data.annotation_types.label.Label’>
The Label objects are created using
lb_types.Label(data={"uid": uid}, annotations=annotations)
Annotations is a list of objects generated from this code:
color = (4) # 1 - 4 depending on class
mask_data_4 = lb_types.MaskData.from_2D_arr(composite_mask)
mask_annotation_4 = lb_types.ObjectAnnotation(
name="XXXXXX", value=lb_types.Mask(mask=mask_data_4, color=color)
)
Running my script with logging.DEBUG results in the following before the error:
DEBUG:labelbox.client:Query: query getModelAssistedLabelingPredictionImportPyApi($projectId : ID!, $name: String!) {
modelAssistedLabelingPredictionImport(
where: {projectId: $projectId, name: $name}){
errorFileUrl inputFileUrl name progress state statusFileUrl id project{autoAuditNumberOfLabels autoAuditPercentage createdAt dataRowCount description editorTaskType isBenchmarkEnabled isConsensusEnabled lastActivityTime allowedMediaType modelSetupComplete name queueMode setupComplete id updatedAt uploadType}
}}, params: {'projectId': 'XXXXXXXXXX', 'name': 'XXXXXX'}, data None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.labelbox.com:443
DEBUG:urllib3.connectionpool:https://api.labelbox.com:443 "POST /graphql HTTP/1.1" 200 None
DEBUG:labelbox.client:Response: {"data":{"modelAssistedLabelingPredictionImport":{"errorFileUrl":null,"inputFileUrl":"XXXXXXXXXXXXXX","name":"XXXXXXXXX","progress":"100%","state":"FAILED","statusFileUrl":null,"id":"XXXXXXXXXXXXX","project":{"autoAuditNumberOfLabels":3,"autoAuditPercentage":0,"createdAt":"XXXXXXXX","dataRowCount":1214,"description":"XXXXXXXX","editorTaskType":null,"isBenchmarkEnabled":true,"isConsensusEnabled":true,"lastActivityTime":"XXXXXXXXX","allowedMediaType":"IMAGE","modelSetupComplete":null,"name":XXXX,"queueMode":"CATALOG","setupComplete":null,"id":"XXXXXXXXX","updatedAt":"XXXXXXX","uploadType":"MANUAL"}}}}
Script terminates while trying to print upload_job.errors
"XXXX/labelbox/schema/annotation_import.py", line 64, in errors
return self._fetch_remote_ndjson(self.error_file_url)
"XXXX/labelbox/schema/annotation_import.py", line 141, in _fetch_remote_ndjson
raise ValueError("Import failed.")
Due to self.error_file_url being None I have hit a roadblock. Has anyone encountered this error before? Any help would be greatly appreciated.
Note: The job is listed as failed in the project notifications tab.