Closed Kevinoop closed 5 years ago
Can you share which code you used here? Based on the images it looks like the step counter is going to 170 and then going back and starting over, but can't be sure without seeing the code.
Note that if you use epochs in your loop (i.e. loop over epochs and in it a loop over batches) then pass the step
value as a tuple. For example, hl.log( (epoch, batch), ....)
.
I only copied your code on github.
The code looks good, and I tested it again to be sure and it's working correctly. I'm really puzzled by the drawing that you got. Did you change anything in the library itself?
I didn't change anything in the library . I'm really strange, too. But I find that it will be nice if I change figure in the following .
Interesting! And, another observation: in your first graph, the x-axis shows 10, 100, 110, ...etc. There is no 20, 30, 40. It's as if the values are being sorted like strings rather than integers. Do you have any global setting that might affect the x-axis of matplotlib?
I check carefully and I do not set any global Settings. I'm also surprised that the x-coordinate is normal at first when drawing the picture at the beginning (10,20,...,70), and then it gets messy afterwards ( jump to 100,110,...)
And I find a interesting thing- the code in the following
if step % num ==0:
when the variable num>=100, the picture will be nice and when num<100, the picture will be in mess.
I like your resource very much and hope my problem will be solved, meanwhile, thank you for taking the time to answer my questions.
In the process of drawing, the X-axis gets messy.
Yes, your last comments confirm my suspicion that the x-axis is being sorted as a string rather than integer.
For example, 10, 20, 30, 40, 50, 60, 70, 80, 90. These will be sorted corrected both as string and integer.
However, once you add 100, it becomes 10, 100, 20, 30, 40, ...etc. Because 10 and 100 both start with "1", so they get sorted before 20, which starts with "2". Then you add 110, and the order becomes 10, 100, 110, 20, ....etc.
So we know the x-axis is being treated like a string. Now we need to know why. There are two possibilities:
Why can’t I get a dynamic picture in the same code? .... I only can get the saved .png images...
@Kevinoop I'm going to close this issue because it's been inactive for a while, and it seems that it's specific to your setup, as far as I can tell. If you discover anything new that might explain the issue, please do post it here for the benefit of others.
Why did I use your code to draw the picture in a mess? I don't know where it is wrong because I just copy your code on github.