Open mmrmas opened 2 years ago
Ok, could you please send the url that you are downloading the image from?
@mmrmas Yes, this issue was created intentionally to give the students a reason to use the issues section, using requests.get is a preferred method to get the image, also the hosting site used to upload the image provides several links and not all of them work with urllib.request.urlretrieve.
Using the cells below, try a different link and request.get and it should work,
@jamescavanagh this was the file: https://github.com/mmrmas/ant/blob/master/orientation-notebook-local.ipynb
Ok, great, so you did the right thing by creating an issue from the intentionally created error! Well done!
I had an issue with the urllib.request.urlretrieve function. It downloaded the sample-cat.jpg file without error messages but stored it as a corrupted file. I borrowed the requests.get() code from one of the blocks below to make it work.
Note that I changed the working directory to make the files visible in the browser Note that it's not essential to generate the variable _imagedata , the model will also accept the jpg file name under _imagefilename . But this may be different for other datatypes, perhaps The model can now be called by
prediction_label, p, probabilities = image_learner.predict(image_filename)