SoFunction
Updated on 2024-11-17

Solution to the problem of displaying images while debugging pycharm

After checking the guide and asking my elder brother, I finally solved my problem ==

After thinking about it, there's no chance someone will make the same mistake as me (well,, probably not many) writing a trip log.

Click show python promt

Enter the following (similar) command

import  as plt
(imgs)

Here's the kicker! The variable must be in the active box you are currently debugging.

This way you can realize the goal of displaying images.

Finally, the question arises, what kind of pit have I gotten myself into?

import  as plt
(ns, ns, i + 1).imshow(imgs[i].transpose(1, 2, 0))
(boxes[[0, 2, 2, 0, 0]], boxes[[1, 1, 3, 3, 1]], '.-')
('off')

The above is my direct copy from the code, originally thought there would be no problem,, careful you must have found,, the problem is big, it lies in the I did not write the

()

Ahhhhhh!!!

Addendum: pycharm run after the graphic effects obtained after the flash solution

1. Description of the problem:

In the demo at the end of section 2.3 of Learning Reinforcement Learning in Depth, the last graphic window that was run closed automatically.

2. Solutions:

Import the turtle package first line of code and add the second line of code at the end of the code.

import turtle
()

3. Results

The above is a personal experience, I hope it can give you a reference, and I hope you can support me more. If there is any mistake or something that has not been fully considered, please do not hesitate to give me advice.