Change:
Traceback (most recent call last): File "", line 322, in &lt;moduleroislabel = fasterRCNN(imdata, iminfo, gtboxes, numboxes) File "/usr/local/lib/python2.7/dist-", line 491, in call result = self.forward(input, kwargs) File "/home/faster-", line 50, in forward rois, rpnlosscls, rpnlossbbox = self.RCNNrpn(basefeat, iminfo, gtboxes, numboxes) File "/usr/local/lib/python2.7/dist-", line 491, in call result = self.forward(input, kwargs) File "/home/faster-", line 87, in forward rpndata = self.RPNanchortarget((, gtboxes, iminfo, numboxes)) File "/usr/local/lib/python2.7/dist-", line 491, in call result = self.forward(input, kwargs) File "/home/faster-", line 157, in forward positiveweights = 1.0 / numexamples File "/usr/local/lib/python2.7/dist-", line 320, in rdiv return self.reciprocal() other RuntimeError: reciprocal is not implemented for type Exception NameError: "global name 'FileNotFoundError' is not defined" in &lt;bound method of object at 0x7fb842e6e3d0ignored This error is coming while implementing pytorch faster-rcnn repository. Any solutions please??
can you use the issue template, we need more information to help you.
Using Pytorch 0.3.0 solves the problem.
are you using python 2? AFAIK FileNotFoundError only exists in python 3, so this should be fixed Also, this error is hiding the real bug in the code, which seems to be the following: Did you mean to take the reciprocal of a LongTensor?
does the shutdown workers FileNotFoundError happen on python 2.7 as well?
I haven't tested on py2. But I believe it should be an with errno.
Yup I am using Python 2. To overcome this error of FileNotFoundError I have downgraded Pytorch from 0.4.0 version to 0.3.0. Use Pytorch 0.3.0 with Python 2, it will work fine.
alternatively, upgrading to Python 3 will fix the issue (and Python 3 is nicer than Python 2). We'll fix this though.
For a quick fix you can make python2 compatible by defining FileNotFoundError somewhere
This error still exist in pytorch 0.4
Yes it is fixed after 0.4
I am still getting it...
did you build pytorch from source? It was fixed after 0.4 is released, so it will be in the next pytorch release.
I updated it via
Can anyone help me with my problem?
I was also working with faster r-cnn and got the error. Downgrading to 0.3.0 solved FileNotFoundError but will produce another error: self.ratiolistbatch[leftidx:(rightidx+1)] = ((np.float64)) # trainset ratio list ,each batch is same number TypeError: 'module' object is not callable Where this error is related to in the above error message. Upgrading can solve this error but will produce the previous one. How do you cope with the second error?

Discussion:
int_classes = int <ins> if PY2: FileNotFoundError = IOError else: FileNotFoundError = FileNotFoundError </ins> def with_metaclass(meta, *bases): """Create a base class with a metaclass.""" # This requires a bit of explanation: the basic idea is to make a dummy

from collections import defaultdict import torch <del> try: FileNotFoundError except NameError: # py2.7 FileNotFoundError = IOError </del> <ins> from torch._six import FileNotFoundError </ins> class range(object):

import traceback import os import time <del> from torch._six import string_classes, int_classes </del> <ins> from torch._six import string_classes, int_classes, FileNotFoundError </ins> IS_WINDOWS = sys.platform == "win32" if IS_WINDOWS: