[Tutor] Handle and display results

ThreeBlindQuarks threesomequarks at proton.me
Fri Apr 28 13:58:34 EDT 2023


Sam,

I read all the attachments left after they were all stripped away and that is a polite way of telling you that this mailing list does not accept attachments. Sending in-line properly-formatted code works but please do not send thousands of lines and just focus in on what you specifically need.

If I read you correctly, many of the details are not important or relevant. I think you are stuck at a particular point albeit having cobbled lots of different things together, it may well be that things are broken way earlier.

You say you trained a convolutional neural network on some images. I am not clear on what follows, but the goal usually is to withhold some (random) images from the training and then use the prediction methods to analyze these additional images for whatever purpose you intended, such as recognizing if the image is of a dog or a cat or whatever.

So what exactly are you trying to do that fails and how does it fail?

Note that training a model does not normally alter any of the images fed into creating the network. I am not clear on what you want. Maybe others here can read between your lines but it may be best if you pause and explain carefully and clearly.

If you supply a list of new images to try and get back a list of results, typically the result is not an image but an “answer” or “selection” of sorts, you could show the code you have that tries to do just that last part, such as taking an item at a time from the list and displaying or printing it perhaps as a combination of the original image alongside the resulting classification.

Or are you asking a different question having nothing to do with the training such as how to see the pictures you were training on?

Do note few people here are unlikely to want to actually run your code and fix it. My personal goal is to be helpful in getting people to help themselves and that begins with them properly explaining what they want to do and show the small amount of code that tries to do it and also shows what is expected versus what they see. Often just doing that lets them solve a problem. 

So before asking for more help, look at the variables or data structures where you expect your result to be and see if they look right. Trying to display an image if the variable is null or of the wrong type does not work, nor does using the wrong function. Generally, you cannot type “print(image)” but may have more luck using whatever graphics library normally displays an image of that type if also given enough info such as how many pixels it contains in each direction and other such info.

Best of luck,

Kyu




Sent with Proton Mail secure email.

------- Original Message -------
On Friday, April 28th, 2023 at 7:10 AM, sam muhammed <sun.exp14 at gmail.com> wrote:


> Dears,
> 
> Good day!
> 
> 
> 
> I am a beginner in Python programming and the field of
> classification images using CNN
> 
> I try to study the publicly available code in Google Collab or Kaggle to
> reuse it.
> 
> 
> 
> I have a problem with how to display the resulting images after training
> the model (as one image with its label at a time) beginning from the first
> image until the last one in the dataset. So that in the end, I get all the
> images that have been trained in the model, not just one image or 9 images
> as in code).
> 
> I would like your help correcting the code in order to get all the
> results of the predictions images.
> 
> 
> 
> I will attach the program code for you to fix it.
> 
> 
> 
> All the best,
> 
> SAM.
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list