question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Object detection( Prediction ) AttributeError: 'CustomVisionPredictionClient' object has no attribute 'predict_image'

See original GitHub issue

Hello,

I´m trying to connect my object detection project to my host application, and I’ve already trained my Model, and I have the iteration id and project ID. I would just like to use the prediction code in my application, I tried to do the same code found here which is :

! pip install azure-cognitiveservices-vision-customvision
from azure.cognitiveservices.vision.customvision.prediction import CustomVisionPredictionClient

my_project_id = "Project Id from the settings page" 
prediction_key = "Prediction Key from the settings page"

ENDPOINT = "https://southcentralus.api.cognitive.microsoft.com"
predictor = CustomVisionPredictionClient(prediction_key, endpoint=ENDPOINT)
my_iteration_id = "iteration id from portal"

with open("Swimming/14.jpg", mode="rb") as test_data:
    results = predictor.predict_image(my_project_id, test_data, iteration_id=my_iteration_id)

but, I still receiving this error :

Traceback (most recent call last): File “cazurecloud.py”, line 22, in <module> results = predictor.predict_image(my_project_id, test_data, iteration_id=my_iteration_id) AttributeError: ‘CustomVisionPredictionClient’ object has no attribute ‘predict_image’

Any Help, please !

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
v-jaswelcommented, Dec 10, 2019

Thank you - I will try to reproduce that and see what might cause it.

1reaction
v-jaswelcommented, Dec 6, 2019

Hi @mrsalhaoui, thank you for the detailed screenshot and I am sorry to hear that didn’t resolve the issue. I will continue investigating and will try to reproduce those errors you are getting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'TFLiteKerasModelConverterV2' object has no attribute 'predict'
You are creating a TFLiteConverter object from your weights file. The correct way to load the model weights is using load_weights link. Try:...
Read more >
'Functional' object has no attribute 'predict_classes'' - Data ...
I was able to fix my issue by making the following changes. From: # Making prediction y_pred = (model.predict_classes(testX)) y_true ...
Read more >
azure-cognitiveservices-vision-customvision 3.1.0 - PyPI
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. ... DetectImage and DetectImageUrl for object detection projects . Prediction...
Read more >
Why am I getting AttributeError: Object has no attribute?
PYTHON : Why am I getting AttributeError : Object has no attribute ? [ Gift : Animated Search Engine ...
Read more >
AttributeError: 'NoneType' object has no attribute 'shape' - Reddit
Hi, I am trying to train custom object detection to detect my company-logo, everything went well until this error, I also deleted and ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found