Record a strange little problem.
In order to complete the emotional dialogue project arranged by my tutor, I found a model from GitHub, and then configured the environment python2.7 + tensorflow1.13.1 on the server according to readme. At the beginning of training, I found that the training speed was very slow. After checking, I found that I didn’t use the GPU version of tensorflow, so I changed it to tensorflow-gpu1.13.1.
Import error: libcublas. So. 10.0: cannot open shared object file: no such file or directory
Very common old problem, CUDA is not installed or environment variables are not configured. I didn’t add CUDA to the environment variable here, because it’s a server in the school laboratory. It doesn’t have sudo permission and can’t modify the environment variable of the system, so I can only add the environment variable I need with the export command every time I start the terminal. For convenience, all the environment variables that need to be exported are recorded in a file. You only need the file source each time.
After the source is completed, a strange problem appears. I output Python 3.8.5 with Python command in CONDA environment, and the python version of the environment shown in CONDA list is 2.7, as shown in the figure below. Clearly is the environment of Python 2.7, why use the python command to prompt that the current version is Python 3.8.5?I try to import tensorflow. It also prompts no module named tensorflow, which means that although it shows that I am in the dual RL master environment, I am in another environment?
I repeatedly tried to delete the environment, create a new environment, and re install various packages. After many tests, I finally found the problem. When CONDA activate is executed, the target environment will be added to the environment variable of the current system, so when the python command is executed on the command line, the python version in the target environment will be executed. When the export command is executed, the specified environment variable will be added to the system environment variable. When the variable name is repeated, the existing environment variable will be overridden. When I use source to execute files containing many export commands, one of the export commands adds the default Python version of CONDA to the environment variables of the system, which covers the python version I activated with CONDA before. Therefore, although my CONDA shows that the python version I used is 2.7, the environment variables of the system have been covered by the export command I used later, The default version of Python is 3.8.5.
I tested again. First add a python version to the environment variable by using export, and then use CONDA activate to activate another version of Python. Using Python on the command line, you will find that the output is the later version of Python. Therefore, you can conclude that the one added after the same variable name in the environment variable will override the existing one.
Although it’s not a big problem, sometimes it’s this kind of energy-saving twig that keeps you from finding mistakes.
- The method of getting shell command output in Python
- Error in downloading update creation environment of CONDA: collecting package metadata (current_ repodata.json): failed
- Error: cudaGetDevice() failed. Status: CUDA driver version is insufficient for CUDA runtime version
- [solution] Google Chrome browser hijacked by hao123 chrome://version Command line tampered
- [solved] runtimeerror: module compiled against API version 0xc but this version of numpy is 0xb
- Solve the problem of Python in Windows environment: Fatal error in launcher: Unable to create process using’”‘ in pip installation
- Python – [encoding] in Python os.system Solution to Chinese garbled code when calling CMD command
- CONDA creating virtual environment and common CONDA commands
- RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
- This version of chromedriver only supports chrome version 92 crawler simulates the problem of Google plug-in version when the browser clicks and reports an error
- Version 1.8.0_201 of the JVM is not suitable for this product. Version: 11 or greater is required.
- Python data cleaning — delete failed images__ Simple version
- The binary version of its metadata is 1.5.1, expected version is 1.1.16
- conda install failed: conda.core.subdir_ data.Response304ContentUnchanged Python cannot be installed
- Start eclipse and prompt version 1.7.0_ 79 of the JVM is not suitable for this product. Version: 1.8 or greater i…
- Eclipse specifies JDK version to start, and resolves version XXXX of the JVM is not suitable
- ERROR 1148 (42000): The used command is not allowed with this MySQL version
- Command line is too long. Shorten command line for QuestionnaireApplication or also for Spring Boot
- Error encountered while executing PIP install: error: complete output from command Python setup.py egg_ info:
- Using CONDA virtual environment in pychar