Write the directory title here
- A series of bugs encountered in deep learning
-
- VScode cannot activate conda
- 1.vscode reports error when loading web view
- 2.CUDA out of memory
- 3.txt file in voc2007 data set
- 4.object has no attribute ‘cache‘
- 5.KeyError:'model'
- 6.No module named loguru
- 7.Python AttributeError: module ‘distutils‘ has no attribute ‘version‘
- 8.No module named 'scipy'
- 9.anaconda configuration h5py===2.10.0
A series of bugs encountered in deep learning
VScode cannot activate conda
Open vscode, select File-Preferences-Settings in the upper left corner
Click the small icon in the upper right corner
After entering setting.json, add a line code, restart the VScode terminal to successfully activate conda
“terminal.integrated.defaultProfile.windows”: “Command Prompt”
1.vscode reports error when loading web view
Error: Could not register serviceworkers: InvalidstateError: Failed to regist
Solution
Close vscode, win+R, enter cmd, enter command
code --no-sandbox can be solved smoothly
2.CUDA out of memory
CUDA out of memory. Tried to allocate 26.00 MiB (GPU 0; 8.00 GiB total capacity; 19.13 GiB already allocated; 0 bytes free; 19.15 GiB reserved in total by PyTorch)
Solution
It may be that the batch_size is set too large during the training process, resulting in insufficient memory. Just reduce the batch_size number
3.txt file in voc2007 data set
train.txt is a list of file names of training image files (training set)
val.txt is a list of file names of verification image files (validation set)< a i=2> trianval.txt is the file name list of training and verification image files test.txt is the file name list of test image files (test set) train is the file name used by the network model during training, and val is the file name used by the network model during testing during training. Val does not affect model training. During training, you can get the error rates of the two data sets, train and val. Use this error rate to draw the learning curve and observe the learning curve. You can find some network model problems and adjust the network based on these problems. parameter. test is to test the network model after training.
4.object has no attribute ‘cache‘
Change around 190 lines under yolox/data/datasets/voc.py
@cache_read_img
def read_img(self, index, use_cache=True):
change into
@cache_read_img(use_cache=True)
def read_img(self, index):
Change the yolox/data/datasets/voc.py file
(self._imgpath % self.ids[i]).split(self.root + “/”)
(self._imgpath % self .ids[i]).split(self.root + “\\”)
5.KeyError:‘model’
The weight file cannot be found, just replace the weight file (.pth).
6.No module named loguru
To activate the environment, enter
pip install loguru -i https://pypi.tuna.tsinghua.edu.cn/simple
7.Python AttributeError: module ‘distutils‘ has no attribute ‘version‘
It is not recommended to upgrade the torch version here. It is likely that the torch will no longer match the version of other packages in the environment after the upgrade, and the default upgrade command upgrades the CPU version of torch
**Solution:** After activating the virtual environment configured by anaconda, enter
pip install setuptools==59.5.0
Fix the version to successfully solve this bug
8.No module named ‘scipy’
pip install scipy
9.anaconda configuration h5py===2.10.0
conda uninstall h5py
conda install h5py==2.10.0
We will update it if we encounter any problems in the future.