有些小bugs几行指令就能解决,写太多不好,这里就进行一个2022-2023这段时间的bugs collection和solution。
a = nn.Torch([])
b = torch.empty(2,3)
for i in rang(3):
a = torch.cat(a, b, dim=0)
pip uninstall onnx; pip install onnx==1.11
参考:
onnx
Try running yolov3_onnx sample
windows不支持:
No, it is not supported on Windows. The reason is that multiprocessing lib doesn’t have it implemented on Windows. There are some alternatives like dill that can pickle more objects.
类似问题:
Can’t pickle local object ‘DataLoader.__init__.<locals>.<lambda>'
参考资料:
Can’t pickle local object ‘DataLoader.init..’
windows上安装detectron2出现了这个问题。
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
解决办法是卸载visual studio然后安装最新版。
Never use google colab!!!
亚洲地区不适用,别用,会断连。
Use python 3.10.
Model.named_parameters()会忽略掉一些参数,比如:
Conv1.Bn.running_mean
Conv1.Bn.running_var
Conv1.Bn.num_batches_tracked
解决方法,用model.state_dict():
for k, v in model.state_dict().items():
print k
print type(v)
参考资料:
Model.named_parameters() will lose some layer modules
Mean and std should be assigned to avoid bias.

解决方法:
conda install imgaug
在cmd等命令窗口卸载imagua。Uninstall imagua in user folder by cmd.
pip uninstall imagua
从
self.F1ScoreDF = self.F1ScoreDF.append(pd.DataFrame(TCnn.F1Score).T)
改成
self.F1ScoreDF = pd.concat([self.F1ScoreDF, pd.DataFrame(TCnn.F1Score).T])
Map类型的数据不要用来做label。It is nothing about figure size, but just the label names are stored by map object, which is unreasonable.
ax.set_yticks(np.arange(data.shape[0]), labels=ClassNames)
ClassNames = map(str.upper, opt.class_names)
to
ClassNames = list(map(str.upper, opt.class_names))
出现:
imgviz.instances2rgb 'FreeTypeFont' object has no attribute 'getsize'
解决办法downgrading pillow
pip install "pillow==9.5.0" --force-reinstall
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, please see http://www.intel.com/software/products/support/.
解决方法:
将mkl在anaconda得navigator删除。
remove mkl in anaconda navigator。
conda update libstdcxx-ng
参考资料:
Anaconda libstdc++.so.6: version `GLIBCXX_3.4.20’ not found
conda install -c conda-forge scikit-learn
git config --global --get http.proxy
参考:
Getting Git to work with a proxy server - fails with “Request timed out”
! [remote rejected] main -> main (Internal Server Error)
error: failed to push some refs to 'https://github.com/anthonyweidai/Advanced_SPL_Classification.git'
解决方法:
git config --bool core.bare true
参考:
Git push error ‘[remote rejected] master -> master (branch is currently checked out)’
git config --unsetcore.bare
参考:
[FIXED] fatal: this operation must be run in a work tree
The term 'conda' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again
解决方法:
Add
S:\ProgramData\Anaconda3
S:\ProgramData\Anaconda3\Scripts
S:\ProgramData\Anaconda3\Library\bin
to environment.
Or install anaconda with adding path environment option.
Reboot computer.
conda init powershell
conda init cmd.exe
git config --global core.ignorecase false
参考资料:
How do you change the capitalization of filenames in Git?
Click the file inside the zip, and then unzip inside files directly.
下载Nodejs,download Nodejs.