Jun-CEN / SegmentAnyRGBD

Segment Any RGBD
Other
773 stars 45 forks source link

Problem with ui.py #4

Open YuRui-Learning opened 1 year ago

YuRui-Learning commented 1 year ago

Hello, thanks for u great job. When i run ui.py, in my own GPU , i meet a problem like loading the yaml WARNING [06/14 10:03:14 fvcore.common.config]: Loading config configs/ovseg_swinB_vitL_demo.yaml with yaml.unsafe_load. Your machine may be at risk if the file contains malicious content. And the bug like

Traceback (most recent call last):
  File "/home/sport/.local/lib/python3.8/site-packages/gradio/routes.py", line 422, in run_predict
    output = await app.get_blocks().process_api(
  File "/home/sport/.local/lib/python3.8/site-packages/gradio/blocks.py", line 1323, in process_api
    result = await self.call_function(
  File "/home/sport/.local/lib/python3.8/site-packages/gradio/blocks.py", line 1051, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/home/sport/.local/lib/python3.8/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/home/sport/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/home/sport/.local/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "ui.py", line 93, in greet_sailvos3d
    demo = VisualizationDemo(cfg)
  File "/home/sport/3d_seg/SegmentAnyRGBD/open_vocab_seg/utils/predictor.py", line 151, in __init__
    self.predictor = OVSegPredictor(cfg)
  File "/home/sport/3d_seg/SegmentAnyRGBD/open_vocab_seg/utils/predictor.py", line 27, in __init__
    super().__init__(cfg)
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/detectron2/engine/defaults.py", line 288, in __init__
    checkpointer.load(cfg.MODEL.WEIGHTS)
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/detectron2/checkpoint/detection_checkpoint.py", line 52, in load
    ret = super().load(path, *args, **kwargs)
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 143, in load
    checkpoint = self._load_file(path)
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/detectron2/checkpoint/detection_checkpoint.py", line 88, in _load_file
    loaded = super()._load_file(filename)  # load native pth checkpoint
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/fvcore/common/checkpoint.py", line 240, in _load_file
    return torch.load(f, map_location=torch.device("cpu"))
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/torch/serialization.py", line 608, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/home/sport/anaconda3/envs/ovseg/lib/python3.8/site-packages/torch/serialization.py", line 777, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
EOFError: Ran out of input

Can you help me about this issue?

Jun-CEN commented 1 year ago

It looks like you did not have the checkpoint file for OVSeg. Please download the ovseg_swinbase_vitL14_ft_mpt.pth and put it under the repo.

YuRui-Learning commented 1 year ago

thanks ,i just find the pth file in my folder is corrupted . And when i run ui.py, i find RuntimeError: CUDA out of memory so how can i change the batch size or other parameters to lighten the memory ,and so on, my GPU memory is about 8 GB. Thank you for all your assistance.

Jun-CEN commented 1 year ago

The default batch size is 1 so it cannot be reduced further. Maybe you could try smaller OVseg and SAM and find whether 8 GB memory is enough.

YuRui-Learning commented 1 year ago

Fine , thanks a million.