0. Problem description: COCO dataset training to half suddenly interrupted, look at the C disk shows red, there is not much memory (training, generated in AppData/Temp in the temporary file too much)
As shown in the figure: as the epoch increases, the file is getting bigger and bigger (the figure is still yolox-tiny), if we use yolox-x, the C drive is directly full!
1. Problem Cause.
YOLOX-main/yolox/evaluators/coco_evaluator.py in line 203 or so **tempfile.mkstemp()** after creating the file, no close() and remove() operations are performed
The following figure.
2. Solution methods
(1) Method 1
As shown above, add os.close(_) and os.remove(tmp) two lines of code, directly delete the file just created after use. Note: import os module at the beginning]
(2) Method 2
The problem is already known, you can use with…as… to create, automatically delete and close the file.
(3) Method 3
If you want to keep each temporary file, and do not want to C drive blow up, then directly change the save location to a custom path.
Code location: Anoconda/envs/using-environment/Lib/tempfile.py in line 159-185.
directly change the direct dirlist operation to the user-defined folder location, as follows:
(4) Method 4
Manually clean up files in temp at regular intervals
Note: VOC format dataset training, no temporary files are generated because it uses the with…as… file creation method. For details, please refer to the end of voc_evaluater.py
Read More:
- To solve the problem that the loss of verification set of resnet50 pre-training model remains unchanged
- Pytorch: How to Handle error warning conda.gateways.disk.delete:unlink_or_rename_to_trash(140)
- [Solved] RuntimeError: Error(s) in loading state dict for YOLOX:
- [Solved] ByteTrack Error: ModuleNotFoundError: No module named ‘yolox’
- Pytorch ValueError: Expected more than 1 value per channel when training, got input size [1, 768
- How to Solve word2vec Module Error: AttributeError & UnicodeDecodeError
- Mxnet.gluon Load Pre Training
- How to Solve Python AttributeError: ‘module’ object has no attribute ‘xxx’
- Python: How to Solve error While importing windpy
- How to Solve Python3.9 Install pycrypto Error
- How to Solve Pytorch eval Stuck Error
- [Solved] Model training Error: _pickle.PicklingError: Can’t pickle
- Full explanation of SYS module of Python
- Pychart: How to Solve myspyder.items import myitem Error
- [Solved] Training yolov5 Error: attributeerror: can get attribute sppf on Module
- PyCharm: How to Solve Tensorflow_datasets Import Error
- YOLOX Model conversion error: [TensorRT] ERROR: runtime.cpp (25) – Cuda Error in allocate: 2 (out of memory)
- Python: How to Solve mysqlclient Install Error in Mac
- How to Solve PyInstaller Package Error: ModuleNotFoundError: No module named ‘xxxx‘
- How to Solve Turtle_tf Error in ROS