python - AttributeError: 'int' object has no attribute ...
stackoverflow.com › questions › 34301687Dec 16, 2015 · AttributeError: 'int' object has no attribute 'encode'. And here is the program. from tkinter import * import random,os,sys,shelve,pickle def atoi (s): rtr=0 for c in s: rtr=rtr*10 + ord (c) - ord ('0') return rtr class Application (Frame): "a application baced GUI" def __init__ (self,master): "to initilize the frame" super (Application,self).__init__ (master) self.grid () self.create_widgets () def create_widgets (self): self.bttn_to_sumbit = Button (self,text = "SHOOT!",command ...
python : AttributeError: 'str' object has no attribute 'keys'
www.py4u.net › discuss › 181601AttributeError: 'str' object has no attribute 'keys'. This is the main code: def generate_arrays_for_training(indexPat, paths, start=0, end=100): while True: from_=int(len(paths)/100*start) to_=int(len(paths)/100*end) for i in range(from_, int(to_)): f=paths [i] x = np.load (PathSpectogramFolder+f) if('P' in f): y = np.repeat ( [ [0,1]],x.shape [0], axis=0) else: y =np.repeat ( [ [1,0]],x.shape [0], axis=0) yield(x,y) history=model.fit_generator (generate_arrays_for_training (indexPat, ...