In the Exercise - Upload the data portion of the module, one of the options provided to upload the images is to use Python and the Custom Vision SDK to upload and tag images. In the section discussing this, there is a repo that we may clone so we can download the code right away instead of coding the upload script from scratch. However, executing the downloaded code results in errors. Furthermore, there are a number of discrepancies between the downloaded code and the code provided in the instructions.
To Reproduce
Steps to reproduce the behavior:
Clone the repo mentioned in the instructions onto your local machine.
Navigate to the local repository and unzip the bird-photos zip file in the project directory.
Open the jupyter notebook file and replace the path provided in the os.chdir() function with the path to where your photos are stored.
Replace the ENDPOINT and training_key variables with the endpoint and training key provided by your Custom Vision resource.
Select the "Run All" cells option for the notebook.
Error is encountered (invalid arguments)
Expected behavior
Images should be uploaded onto your created Custom Vision project and the model can be trained, published, and tested using the downloaded script.
Fix
Update the CustomVisionTrainingClient function call in the "Create Custom Vision Project" section.
Update the create_images_from_files function call under the uploadImageList function in the "uploadImageList function to upload list of images" section.
upload_result = trainer.create_images_from_files(project_id=project.id, batch=ImageFileCreateBatch(images=image_list)) # ImageFileCreateBatch is imported from azure.cognitiveservices.vision.customvision.training.models
Update the CustomVisionPredictionClient function call at the start of the "Test the published endpoint" section.
Desktop (please complete the following information):
OS: Windows 10
Browser chrome
Version 110.0.5481.104 (Official Build) (64-bit)
Additional context
Attached below are the details elaborating on how I discovered the issues and how I came about fixing them.
Under the "Create Custom Vision Project" cell, we run into an error saying we got multiple values for the 'endpoint' argument upon initializing CustomVisionTrainingClient.
Upon reviewing the instructions provided in the module, the following is the code that's supposed to be utilized, which is different from the downloaded code.
Updating the downloaded code to follow the code from the module results in the successful creation of a project.
However, another issue is encountered in the "Loop thru tags and call each function..." cell which comes from a faulty function call under the uploadImageList function.
Once again, another discrepancy is found between the function call from the downloaded code and the function call from the code provided in the instructions, the difference being the create_images_from_files function call.
However, changing this to the code provided by the instructions results in a different error.
According to this issue, the issue can be fixed by updating the create_images_from_files function call. Doing so stops the error from occurring.
Describe the bug
In the Exercise - Upload the data portion of the module, one of the options provided to upload the images is to use Python and the Custom Vision SDK to upload and tag images. In the section discussing this, there is a repo that we may clone so we can download the code right away instead of coding the upload script from scratch. However, executing the downloaded code results in errors. Furthermore, there are a number of discrepancies between the downloaded code and the code provided in the instructions.
To Reproduce
Steps to reproduce the behavior:
bird-photos
zip file in the project directory.os.chdir()
function with the path to where your photos are stored.ENDPOINT
andtraining_key
variables with the endpoint and training key provided by your Custom Vision resource.Expected behavior
Images should be uploaded onto your created Custom Vision project and the model can be trained, published, and tested using the downloaded script.
Fix
CustomVisionTrainingClient
function call in the "Create Custom Vision Project" section.create_images_from_files
function call under theuploadImageList
function in the "uploadImageList
function to upload list of images" section.CustomVisionPredictionClient
function call at the start of the "Test the published endpoint" section.Desktop (please complete the following information):
Additional context
Attached below are the details elaborating on how I discovered the issues and how I came about fixing them.
Under the "Create Custom Vision Project" cell, we run into an error saying we got multiple values for the 'endpoint' argument upon initializing
CustomVisionTrainingClient
.Upon reviewing the instructions provided in the module, the following is the code that's supposed to be utilized, which is different from the downloaded code.
Updating the downloaded code to follow the code from the module results in the successful creation of a project.
However, another issue is encountered in the "Loop thru tags and call each function..." cell which comes from a faulty function call under the
uploadImageList
function.Once again, another discrepancy is found between the function call from the downloaded code and the function call from the code provided in the instructions, the difference being the
create_images_from_files
function call.However, changing this to the code provided by the instructions results in a different error.
According to this issue, the issue can be fixed by updating the
create_images_from_files
function call. Doing so stops the error from occurring.Student, Student Ambassador