Whenever I run a Tensorflow model in Python's IDLE with verbose=1
I get a weird line of rectangles in each epoch period (as exemplified below). I changed computer recently and this didn't happen on my previous laptop but in this one is always happening. This is quite annoying because, as you may know, printing more characters slows down the IDLE considerably...
Any ideas how to solve?
Important Note: I placed [ and ] together representing the rectangles because when I printed the text here it actually showed correctly, even without the code formatting.
Thanks in advance for the help!
Info:
Laptop: Acer Aspire 5
OS: Windows 10 - 64 bits
Python's standard IDLE
Python: 3.7
Tensorflow API: 2.0
Example:
16/182 [=>............................] - ETA: 35s - loss: 0.5583 - Accuracy: 0.0000e+00 - MeanSquaredError: 0.1716
18/182 [=>............................] - ETA: 36s - loss: 0.5170 - Accuracy: 0.0000e+00 - MeanSquaredError: 0.1561
20/182 [==>...........................] - ETA: 36s - loss: 0.5008 - Accuracy: 0.0000e+00 - MeanSquaredError: 0.1496
Is showing like:
22/182 [==>...........................] - ETA: 35s - loss: 0.4803 - Accuracy: 0.0000e+00 - MeanSquaredError: 0.1414[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] 24/182 [==>...........................] - ETA: 35s - loss: 0.4891 - Accuracy: 0.0000e+00 - MeanSquaredError: 0.1483
The issue is that tensorflow formats its in-progress outputs as text to be print()ed, but it is not IDLE-aware and is print()ing text terribly inappropriate for IDLE's shell. (It apparently knows that it is not printing to a standard terminal.) The worse part, for runs longer than what you did, is the omission of newline characters in the output to IDLE (unlike the terminal output). This is exactly the wrong thing. A single line somewhere longer than 10000 characters will eventually freeze the underlying tk graphics framework.
Judging from this screenshop for bpo issue 37762, the rectangles might be inverse bullets either output by Tenserflow or used by the tk Text widget as 'replacement' characters. It might help if you could paste a copy of the rectangles into the following line and run it.
for c in '[]...[]': print(hex(ord(c)))
In my opinion, importable modules such as tensorflow/keras should have APIs returning results as unformatted, unstringified python objects, so that the importing code can display results as the user deems best. Or they should at least offer to return (instead of printing) text strings, preferably easily parsed comma-separated values, that users can process as desired.
If you cannot find an option to change what you get from tensorflow, then you should run in Command Prompt, at least for runs with more than about 50 lines.