[PYTHON] What to do if the Chainer (Windows) sample mnist terminates with WinError 183.

Overview#

I installed Python + Chainer on Windows to start deep learning, which is popular now, and when I ran the sample mnist triumphantly, for some reason it ended with an error and camphor for those who tend to lose their temper. It is an agent. Although the detailed cause has not been clarified, mnist can be executed without any error for the time being.

mnistError.png

environment#

Symptom

When mninst is executed, an error always occurs after epoch ends (when it reaches 100%). The following error message is thrown.

FileExistsError: [WinError 183]You cannot create a file that already exists.: '<PATH_TO_CHAINER_INSTALL_DIRECTORY>\chainer\examples\mnist\result\logofw0i659' -> 'result\log'

Cause

An error occurred because I tried to rename another file to "log" even though a file named "log" existed.

Countermeasure

Do not rename above. (Is it originally wanted to overwrite and save?)

Method#

See the error message on the line above it.

File "C:\Anaconda3\lib\site-packages\chainer\training\extensions\log_report.py", line 94, in __call__
    os.rename(path, os.path.join(trainer.out, log_name))

Comment out the number of lines (line 94) in the file (log_report.py).

log_report.py


#Comment out the following line.
#os.rename(path, os.path.join(trainer.out, log_name))

mnistDebug.png

With the above, the error will not occur. Instead, a large number of log files are generated in the log directory and should be cleaned accordingly. Please be careful.

Digression

It is the execution time measurement result with the default parameter without gpu of mnist. As a reference value.

environment#

result#

Execution time: less than 20 minutes (18 minutes) (This, especially the execution time is not displayed on the screen ...)

Recommended Posts

What to do if the Chainer (Windows) sample mnist terminates with WinError 183.
What to do if the server doesn't start with python manage.py runserver
What to do if the Microsoft Store opens even if you run python on Windows
What to do if the package dependency cannot be repaired
What to do if you are addicted to Windows character code
What to do if you can't sort files with subscripts
What to do if yum breaks
What to do with PYTHON release?
Inference works with Chainer 2.0 MNIST sample
What to do if Python doesn't work on Git for Windows
What to do if you can't install pyaudio with pip #Python
What to do if intellisense doesn't work with Anaconda + VSCode + Tensorflow2.1
What to do if the inode is exhausted on EC2 Linux
What to do if you can't build your project with Maven
What to do if PyAudio cannot be installed on Python 3.7, 3.8, 3.9 on Windows
What to do if you can't use the trash in Lubuntu 18.04.
What skills do I need to program with the FBX SDK Python?
What to do if you can't find well with grep's -f option
What to do if the Pipenv environment is corrupted by updating Homebrew
[Introduction to machine learning] Until you run the sample code with chainer
What to do if you couldn't send an email to Yahoo with Python.
What to do if ipython and python start up with different versions
What to do if you get lost in file reference with FileNotFoundError
What to do if pyenv install does not proceed with an error
What to do if an error occurs when importing numpy with VScode
What to do if you get a TypeError with numpy min, max
What to do if you get an error when trying to load mnist
What to do if you can't install with pip in babun environment
What to do if you get Could not fetch URL 443 with pip
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
Example of what to do when the sample script does not work (OpenCV-Python)
What to do if you get angry with swapon failed: Operation not permitted
What to do if pipreqs results in UnicodeDecodeError
What to do if you can't pipenv shell
Note: What to do if pip install fails
What to do if mod_fcgid cannot resolve UnicodeEncodeError
Let's Encrypt updated! What to do if the certbot renew command doesn't work
What to do if rails s doesn't work
[Note] What to do if the Qt library conflicts between pyqt and opencv
What to do if scrapy doesn't work after installing scrapy with pip on mac
What to do if pip cannot be installed
What to do if you get an error when installing python with pyenv
What to do if atom autocomplete-python doesn't work
What to do if Docker-sync suddenly stops working
What to do if a version error occurs in the selenium Chrome driver
What to do if "amazon-linux-extras" → "No module named amazon_linux_extras"
What to do if (base) is displayed at the beginning of the Mac terminal
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if the print command itself causes an error in Maya python
What to do if the progress bar is not displayed in tqdm of python
What to do if Python IntelliSense is not displayed in VS Code on Windows
What to do if you get an Import Error when importing matplotlib with Jupyter
[Introduction to Python] What is the important "if __name__ =='__main__':" when dealing with modules?
What to do if Python does not switch from the System version in pyenv
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do if you can't hit the arrow keys in the Python interactive console
What to do if you run python in IntelliJ and end with an error
I tried to learn the sin function with chainer
What to do if pip install fails in Xcode 5.1
No module named What to do if you get'libs.resources'
ModuleNotFoundError: No module What to do if you get'tensorflow.contrib'