Nati,

You ask what the problem is in that code. I say there I absolutely NO PROBLEM 
for me in that code.

Do you know why?

Because even if I want to copy it and make sure I have all the modules it 
needs, I have no access to the files it opens, and no idea what the output of 
the images pumped in is supposed to be and so on.

So since I won't try it, it stops being my problem.

Now if you want to know if someone spied any obvious error in the code, who 
knows, someone might. 

But guess who has access to all the code and files and anything else in your 
environment? You!

So why not use your interactive python interpreter and pause between parts of 
the code and insert requests to see what things look like, which is what 
programmers have been doing for decades, or use some debugger?

Check what is being done and if something fails, trace back as to what it was 
being given and see if that is what the manual page suggests you should be 
giving it and so on.

You cannot expect multiple people to keep doing the work for you and especially 
if they keep telling you they need more info.

I know very little about you and what tasks you have agreed to do but suggest 
that it may end up being a lot more work than you anticipated given how many 
kinds of pseudo-questions you seem to have.

What is wrong with your code is that someone else did not write it specifically 
for the purpose you want. My guess is that you copy lots of code from libraries 
or the internet and want to adapt it without necessarily understanding if it 
fits your needs or where it needs to be tweaked.

If I am wrong, I apologize. But if you want help here, or in other forums, 
consider changing your approach and consider what you would want if anyone else 
asked you to help them.

What you keep not wanting to do is supply a fairly simple example of inputs and 
outputs and error messages. Now in this case, if your inputs are images and 
machine learning algorithms are going to  output best guesses about features 
such as what animal is in the picture, it may indeed be harder to give serious 
details. 

When I see a question I can answer, I may chime in but for now, this process is 
too frustrating.

Avi

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail....@python.org> On 
Behalf Of ??? ????
Sent: Monday, July 11, 2022 3:26 AM
To: python-list@python.org
Subject: Fwd: ml on medical images - keras

---------- Forwarded message ---------
מאת: נתי שטרן <nsh...@gmail.com>
‪Date: יום א׳, 10 ביולי 2022, 13:01‬
Subject: Re: ml on medical images - keras
To: Neuroimaging analysis in Python <neuroimag...@python.org>


p.s. all the pictures are in PNG FORMAT

‫בתאריך יום א׳, 10 ביולי 2022 ב-13:01 מאת נתי שטרן <‪nsh...@gmail.com‬‏>:‬

> What's the problem on this code:
>
> import os
> from pickletools import float8, uint8
> from PIL import Image
>
> import numpy as np
> import tensorflow as tf
> from tensorflow import keras
> from tensorflow.keras import layers
> inputs=[]
> for i in os.listdir("c:/inetpub/wwwroot/out"):
>     for j in os.listdir("c:/inetpub/wwwroot/out/"+i+"/"):
>             A=Image.open("c:/inetpub/wwwroot/out/"+i+"/"+j)
>             from matplotlib import pyplot as plt
>
>             filename = 'image-test'
>
>
>           #  img = ( filename + '.png' )
>             x=np.array(A,dtype=np.shape(A))
>             inputs.append(x)
>
> simple_rnn = tf.keras.layers.SimpleRNN(4) #np.int output = 
> simple_rnn(inputs=np.array(inputs,dtype=np.ndarray(260, 730, 4)))  # 
> The output has shape `[32, 4]`.
>
> simple_rnn = tf.keras.layers.SimpleRNN(
>     4, return_sequences=True, return_state=True)
>
> # whole_sequence_output has shape `[32, 10, 4]`.
> # final_state has shape `[32, 4]`.
> whole_sequence_output, final_state = simple_rnn(inputs)
>
> --
> <https://netanel.ml>
>


--
<https://netanel.ml>
--
https://mail.python.org/mailman/listinfo/python-list

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to