Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve 'global name 'FileNotFoundError' is not defined" ? #5

Closed
b2220333 opened this issue May 10, 2015 · 5 comments
Closed

How to solve 'global name 'FileNotFoundError' is not defined" ? #5

b2220333 opened this issue May 10, 2015 · 5 comments

Comments

@b2220333
Copy link

Hello,
I run sed -e 's:python3:python:g' eval_all.sh > sam_eval_all.sh
And here is the output when execute sam_eval_all.sh:

Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined
Traceback (most recent call last):
File "train_lpo.py", line 137, in
over_segs,segmentations,boxes,names = loadVOCAndOverSeg( 'test', detector='mssf' )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 94, in loadVOCAndOverSeg
return loadAndOverSegDataset( lambda: ldr(im_set=="train",im_set=="valid",im_set=="test"), "VOC%s_%s"%(year,im_set), detector=detector, N_SPIX=N_SPIX )
File "/home/sam/code/download/Segmentation/lpo/src/util.py", line 52, in loadAndOverSegDataset
except FileNotFoundError:
NameError: global name 'FileNotFoundError' is not defined

Thank you~

@philkr
Copy link
Owner

philkr commented May 10, 2015

FileNotFoundError apparently doesn't exist in python 2.7 . a1ee437 should fix this.
I also added a environment variable to control the python script in eval_all.sh, so you don't need to copy the script.

@b2220333
Copy link
Author

Oh, it works!
Thank you very much~
By the way, if I have the problem of usage, is it also suitable to open an new issue?

@b2220333
Copy link
Author

I found that it doesn't output anything on console.
Is that normal?
Thank you~

@philkr
Copy link
Owner

philkr commented May 12, 2015

It might be related to a missing VOC/COCO dataset files, see #6 .

@b2220333
Copy link
Author

OK, I update again with git pull and make success!
After I run again ./sam_eval_all.sh, it shows another question, and I will open another issue.
Thank you~

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

No branches or pull requests

2 participants