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

Error running flask-api: RuntimeError: [enforce fail at inline_container.cc:208] . file not found: /version #1

Closed
nitinsurya opened this issue Oct 7, 2020 · 4 comments

Comments

@nitinsurya
Copy link

nitinsurya commented Oct 7, 2020

Downloaded model_final_trimmed.pth file from dropbox link in the repo, placed it in the backend/ folder.

When running docker-compose up --build following error pops up and the flask_api fails to load.

Loaded config: DLA_mask_rcnn_R_101_FPN_3x.yaml
Loaded model: model_final_trimmed.pth
Traceback (most recent call last):
  File "/app/bin/flask", line 8, in <module>
    sys.exit(main())
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 967, in main
    cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/app/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/app/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/app/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/app/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/app/lib/python3.8/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/app/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 848, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 305, in __init__
    self._load_unlocked()
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 330, in _load_unlocked
    self._app = rv = self.loader()
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 388, in load_app
    app = locate_app(self, import_name, name)
  File "/app/lib/python3.8/site-packages/flask/cli.py", line 240, in locate_app
    __import__(module_name)
  File "/app/dla.py", line 3, in <module>
    app = create_app()
  File "/app/project/__init__.py", line 16, in create_app
    from project.api.dla_api import dla_blueprint
  File "/app/project/api/dla_api.py", line 5, in <module>
    from project.predictor import make_predictions
  File "/app/project/predictor.py", line 95, in <module>
    predictor = prepare_predictor()
  File "/app/project/predictor.py", line 38, in prepare_predictor
    predictor = VisualizationDemo(cfg)
  File "/app/project/d2predictor.py", line 36, in __init__
    self.predictor = DefaultPredictor(cfg)
  File "/app/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 187, in __init__
    checkpointer.load(cfg.MODEL.WEIGHTS)
  File "/app/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 120, in load
    checkpoint = self._load_file(path)
  File "/app/lib/python3.8/site-packages/detectron2/checkpoint/detection_checkpoint.py", line 42, in _load_file
    loaded = super()._load_file(filename)  # load native pth checkpoint
  File "/app/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 216, in _load_file
    return torch.load(f, map_location=torch.device("cpu"))
  File "/app/lib/python3.8/site-packages/torch/serialization.py", line 586, in load
    with _open_zipfile_reader(f) as opened_zipfile:
  File "/app/lib/python3.8/site-packages/torch/serialization.py", line 246, in __init__
    super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
RuntimeError: [enforce fail at inline_container.cc:208] . file not found: /version

How can this be resolved?

@hpanwar08
Copy link
Owner

hpanwar08 commented Oct 7, 2020

How did you download the model?

@nitinsurya
Copy link
Author

Did wget from the repo's dropbox url, unzipped the file and used the unzipped model.

Oddly, model dowloaded from https:/hpanwar08/detectron2's dropbox link for MaskRCNN seems to work fine.

@hpanwar08
Copy link
Owner

Try this if it helps hpanwar08/detectron2#22

@nitinsurya
Copy link
Author

Yup, looks like that solves the problem. Closing the ticket.

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