thtrieu / darkflow

Translate darknet to tensorflow. Load trained weights, retrain/fine-tune using tensorflow, export constant graph def to mobile devices
GNU General Public License v3.0
6.14k stars 2.08k forks source link

OSError: [WinError 8] Not enough storage is available to process this command #539

Open tylerlindell opened 6 years ago

tylerlindell commented 6 years ago

getting this error when trying to run python flow --model cfg/tiny-yolo.cfg --load bin/yolo-tiny.weights --demo videofile.avi --gpu 1.0

the full error follows:

D:\dev\darkflow\darkflow\dark\darknet.py:54: UserWarning: ./cfg/yolo-tiny.cfg not found, use cfg/tiny-yolo.cfg instead
  cfg_path, FLAGS.model))
Parsing cfg/tiny-yolo.cfg
Loading bin/yolo-tiny.weights ...
Traceback (most recent call last):
  File "flow", line 6, in <module>
    cliHandler(sys.argv)
  File "D:\dev\darkflow\darkflow\cli.py", line 26, in cliHandler
    tfnet = TFNet(FLAGS)
  File "D:\dev\darkflow\darkflow\net\build.py", line 58, in __init__
    darknet = Darknet(FLAGS)
  File "D:\dev\darkflow\darkflow\dark\darknet.py", line 27, in __init__
    self.load_weights()
  File "D:\dev\darkflow\darkflow\dark\darknet.py", line 82, in load_weights
    wgts_loader = loader.create_loader(*args)
  File "D:\dev\darkflow\darkflow\utils\loader.py", line 105, in create_loader
    return load_type(path, cfg)
  File "D:\dev\darkflow\darkflow\utils\loader.py", line 19, in __init__
    self.load(*args)
  File "D:\dev\darkflow\darkflow\utils\loader.py", line 54, in load
    walker = weights_walker(path)
  File "D:\dev\darkflow\darkflow\utils\loader.py", line 119, in __init__
    dtype = '({})i4,'.format(4))
  File "D:\Programs\Python\Python35\lib\site-packages\numpy\core\memmap.py", line 264, in __new__
    mm = mmap.mmap(fid.fileno(), bytes, access=acc, offset=start)
OSError: [WinError 8] Not enough storage is available to process this command

Any help is great!

running on the following versions

Microsoft Windows 10 Home - 10.0.16299 Build 16299
Python - 3.5.4
tensorflow - 1.4.0
numpy - 1.14.0
SkullPirateTK commented 6 years ago

My guess is that you ran out of system memory.

tylerlindell commented 6 years ago

I was thinking that too but I have 24G RAM and the file size is zero.

tylerlindell commented 6 years ago

since the file is empty, maybe np.memmap is having a hard time with the mode='r' (mode set to read-only) Check out this answer on SO: ValueError on mmap - Python

this might work if the file is empty:

# darkflow/darkflow/utils/loader.py
# weights_walker
# line 109
    def __init__(self, path):
        self.eof = False # end of file
        self.path = path  # current pos
        if path is None: 
            self.eof = True
            return
        else: 
            self.size = os.path.getsize(path)# save the path
            if self.size > 0:
                major, minor, revision, seen = np.memmap(path,
                    shape = (), mode = 'r', offset = 0,
                    dtype = '({})i4,'.format(4))
                self.transpose = major > 1000 or minor > 1000
                self.offset = 16
            else:
                self.eof = True
                return
yc9690 commented 4 years ago

Hey, friend. I have a similar problem with you in pycharm. Do you know how to solve this issue. Thank you.

GitHubOdd commented 2 years ago

I had this error message once, it was because i sent an image file .CR2 into mmap(), rather than the file crated using np.memmap(). The error about memory was just confusing for me.