---------- 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