I'm trying to use Tensorlow on İris dataset using sublime as the text editor. I got this error "TypeError: float() argument must be a string or a number, not 'generator'"when running the session, but I haven't any Idea about it. Please help me out. Attached is the error screenshot.
I don't know precisely what's happening under the hood, but your list comprehensions on lines 31-33 are wrong and causing numpy to produce some funky arrays.
If you pull each of them out of the
np.array calls and attempt to run them, you'll generate a nice
SyntaxError (which is nice because it'll loudly tell us what's wrong!).
Right now, the error is getting suppressed by the fact Python is taking that funky list comprehension and creating a generator expression (I'm guessing due to how Python manages argument packing).
I'm unsure of the intent of lines 31 and 32 (are they supposed to be individual records from the data?), but line 33 can be rewritten as:
rand_y = np.array([binary_target[y_i] for y_i in rand_index])