Hi GiganticTurtle0 ,
Uploading artifact is being done async, maybe this is the issue in your case, you can change it with wait_on_upload=True
, can you try it?
Hi all,
Is there any way to know the upload status of an artifact so that once the upload is completed another action can be performed? I am using a temporary file, since the upload process of an artifact is running in background, during this process the temporary file is removed, so the task does not find the file and it cannot be uploaded as an artifact:2021-10-19 09:00:00,930 - clearml - WARNING - Skipping upload, could not find object file '/user/myproject/tmpgem_lb2b.pickle'
This is the code I'm using to build the mock example:
` from clearml import Task
def main():
import os
import tempfile
task = Task.init(project_name="Mocks", task_name="uploading_artifact_background")
temp_file = tempfile.NamedTemporaryFile(dir=os.getcwd(), suffix=".pickle")
task.upload_artifact(name="temp_scalers", artifact_object=temp_file.name)
print("Artifact successfully uploaded!")
temp_file.close()
print("Getting scalers local copy... Here it is:")
print(task.artifacts["temp_scalers"].get_local_copy())
if name == "main":
main() `
Hi GiganticTurtle0 ,
Uploading artifact is being done async, maybe this is the issue in your case, you can change it with wait_on_upload=True
, can you try it?