AnomalyGPT learning record (1)

This blog post is for your own use

Paper link:https://arxiv.org/abs/2308.15366

Yesterday I read the original text of AnomalyGPT. After downloading the source code and setting up the environment, I found that there was a problem with the conda command. There were no folders in the newly created environment. The conda command reported the following error.

Error loading anaconda_anon_usage: No module named 'anaconda_anon_usage'

I found the anaconda-anon-usage package in anaconda navigator and tried to install it but still reported an error.
I cannot find this error report on the Internet, and there is no explanation about this package. I have no choice but to put this problem aside for now and try to download and install anaconda again.

1. Reinstall anaconda

For the installation and configuration process, please refer to the following blog post, which is very clear.
Anaconda Complete Getting Started Guide

2. Set up the environment

Create an environment named AnomalyGPT, using python 3.9.
Source code link: https://github.com/CASIA-IVA-Lab/AnomalyGPT

Packages required to install the source code:

pip install -r requirements.txt

An error occurred, and after solving it, a new error appeared. After repeating it several times, I found that it was a problem with installing the first package deepspeed==0.9.2.

Other packages in the requirements were installed successfully, among which the torch triple package was usedhttps://blog.csdn.net/weixin_45246566/article/details/127944694?spm= The method in 1001.2014.3001.5501 is compatible with cuda11.6 and python3.9.

Install deepspeed under Windows

If the above steps are successfully completed, an error will be reported if you directly runpip install deepspeed==0.9.2.

Collecting deepspeed
  Using cached deepspeed-0.11.1.tar.gz (1.1 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.exit code: 1
  ╰─> [16 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\JMan\AppData\Local\Temp\pip-install-9dh8e4dg\deepspeed_fea8092a97544116a4f3c782c95cb28a\setup.py", line 100, in <module>
          cuda_major_ver, cuda_minor_ver = installed_cuda_version()
        File "C:\Users\JMan\AppData\Local\Temp\pip-install-9dh8e4dg\deepspeed_fea8092a97544116a4f3c782c95cb28a\op_builder\builder.py", line 43, in installed_cuda_version
          output = subprocess.check_output([cuda_home + "/bin/nvcc", "-V"], universal_newlines=True)
        File "d:\Users\JMan\anaconda3\envs\AnomalyGPT\lib\subprocess.py", line 424, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "d:\Users\JMan\anaconda3\envs\AnomalyGPT\lib\subprocess.py", line 505, in run
          with Popen(*popenargs, **kwargs) as process:
        File "d:\Users\JMan\anaconda3\envs\AnomalyGPT\lib\subprocess.py", line 951, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "d:\Users\JMan\anaconda3\envs\AnomalyGPT\lib\subprocess.py", line 1436, in _execute_child
          hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
      FileNotFoundError: [WinError 2] 系统找不到指定的文件。
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

If you do not specify a version number, runningpip install deepspeed will also report an error.

deepspeed is not friendly to Windows, probably because it does not support functions such as async_io, and it will be easier to install on Linux.

Use the package cloned from git to install it. The method of installing deepspeed on windows according to the readme is the same as the error reported above. For the specific process, you can refer to the following two links:
https://blog.csdn.net/feking2/article/details/130160845
https://github. com/microsoft/DeepSpeed/issues/3145
[When trying this method, a very strange thing is that the win11 home version cannot run the build_win.bat file. The reason is that the administrator rights are insufficient. Upgrade to It will be available after the professional version, which is accompanied by the inexplicable activation of Kingsoft Antivirus, so I have no way of verifying which force has solved this problem. 】

Here is the bitter history of blood and tears of upgrading to the professional version^/\^

 File "C:\Users\JMan\AppData\Local\Temp\pip-install-9dh8e4dg\deepspeed_fea8092a97544116a4f3c782c95cb28a\setup.py"

The file in the error report cannot be found on the computer at all, and there is no solution on the Internet, so it can only be put aside temporarily.

Guess you like

Origin blog.csdn.net/weixin_45246566/article/details/133825871
Recommended