[BUG1 record] The problem that the picture does not display when deep learning fits the data

Problem Description

In the process of deep learning, it is inevitable that the data will be fitted. After using the plt.plot(x, y)drawing operation, when the simulation is running, the picture we need does not appear. plt.show()The problem of missing errors after joining . This problem is an error that occurs when only the data simulation of the vector machine is performed, but it should also appear in other data fitting codes.

Cause Analysis:

Many deep learning frameworks are not windowsdeveloped under the system, and our laptops are more windowscoded under the environment, so we need to call plt.show()methods to display the required pictures. When you see this, you think the answer to the question Found that when you switch back to the compiler again, after adding plt.show()it, the compiler will display the following code error prompt:

OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program. That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. For more information, 

solution:

Just add the following code file at the beginning of your code, and the picture will appear when you run it again

import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'

Test Results:

After adding the codes above plt.show()and in the solution, my program got the desired result, and it ran out of the picture.
insert image description here

Guess you like

Origin blog.csdn.net/dxcn01/article/details/128711966