Skip to content

Conversation

muare
Copy link
Contributor

@muare muare commented Dec 2, 2020

The fix for issue (opencv/opencv_contrib#941) introduced a defect.

Steps to reproduce the defect:

  1. download model GoogleNet using command on windows: python download_models.py GoogleNet
  2. there is an exception and downloading is failed.

Root cause analysis

  1. filename is "bvlc_googlenet.caffemodel"
  2. the basedir for model storage is empty with following statement
    basedir = os.path.dirname(self.filename)
  3. os.path.mkdir('') throws exception
    Traceback (most recent call last):
    File "download_models.py", line 883, in
    if not m.get():
    File "download_models.py", line 66, in get
    os.makedirs(basedir, exist_ok=True)
    File "C:\Users\xiebian\miniconda3\envs\gluon\lib\os.py", line 220, in makedirs
    mkdir(name, mode)
    FileNotFoundError: [WinError 3] 系统找不到指定的路径。: ''

@alalek
Copy link
Member

alalek commented Dec 2, 2020

Thank you for contribution!

This patch should go into 3.4 branch first.
We will merge changes from 3.4 into master regularly (weekly/bi-weekly).

Please:

  • change "base" branch of this PR: master => 3.4 (use "Edit" button near PR title)
  • rebase your commits from master onto 3.4 branch. For example:
    git rebase -i --onto upstream/3.4 upstream/master
    (check list of your commits, save and quit (Esc + "wq" + Enter)
    where upstream is configured by following this GitHub guide and fetched (git fetch upstream).
  • push rebased commits into source branch of your fork (with --force option)

Note: no needs to re-open PR, apply changes "inplace".

@muare muare changed the base branch from master to 3.4 December 4, 2020 15:18
The fix for issue (opencv/opencv_contrib#941) introduced a defect.

Steps to reproduce the defect:
1. download model GoogleNet using command on windows: python download_models.py GoogleNet
2. there is an exception and downloading is failed.

Root cause analysis
1. filename is "bvlc_googlenet.caffemodel"
2.  the basedir for model storage is empty with following statement
     basedir = os.path.dirname(self.filename)
3.  os.path.mkdir('') throws exception
Traceback (most recent call last):
  File "download_models.py", line 883, in <module>
    if not m.get():
  File "download_models.py", line 66, in get
    os.makedirs(basedir, exist_ok=True)
  File "C:\Users\xiebian\miniconda3\envs\gluon\lib\os.py", line 220, in makedirs
    mkdir(name, mode)
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: ''
@muare
Copy link
Contributor Author

muare commented Dec 4, 2020

@alalek thanks for the detailed instruction and it's done.

@alalek alalek merged commit 39ac5d3 into opencv:3.4 Dec 4, 2020
@alalek alalek mentioned this pull request Dec 4, 2020
@alalek alalek mentioned this pull request Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants