SamsungLabs / ritm_interactive_segmentation

Reviving Iterative Training with Mask Guidance for Interactive Segmentation
MIT License
637 stars 125 forks source link

importError: Building module isegm.utils.cython._get_dist_maps failed: ["distutils.errors.CompileError: command 'cl.exe' failed: No such file or directory\n"] #25

Open geoexploring opened 2 years ago

geoexploring commented 2 years ago

The following error is reported when I run demo.py:

(venv) C:\Users\admin\Desktop\RITM>c:/Users/admin/Desktop/RITM/venv/Scripts/python.exe c:/Users/admin/Desktop/RITM/ritm_interactive_segmentation-main/demo.py
Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\spawn.py", line 69, in _spawn_nt
    rc = os.spawnv(os.P_WAIT, executable, cmd)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 424, in compile
    self.spawn(args)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 543, in spawn
    return super().spawn(cmd)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\ccompiler.py", line 910, in spawn
    spawn(cmd, dry_run=self.dry_run)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\spawn.py", line 38, in spawn
    _spawn_nt(cmd, search_path, dry_run=dry_run)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\spawn.py", line 75, in _spawn_nt
    "command %r failed: %s" % (cmd, exc.args[-1]))
distutils.errors.DistutilsExecError: command 'cl.exe' failed: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 215, in load_module
    inplace=build_inplace, language_level=language_level)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 191, in build_module
    reload_support=pyxargs.reload_support)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
    dist.run_commands()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 426, in compile
    raise CompileError(msg)
distutils.errors.CompileError: command 'cl.exe' failed: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:/Users/admin/Desktop/RITM/ritm_interactive_segmentation-main/demo.py", line 60, in <module>
    main(args, cfg)
  File "c:/Users/admin/Desktop/RITM/ritm_interactive_segmentation-main/demo.py", line 15, in main
    model = utils.load_is_model(checkpoint_path, args.device, cpu_dist_maps=True)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\inference\utils.py", line 33, in load_is_model
    return load_single_is_model(state_dict, device, **kwargs)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\inference\utils.py", line 37, in load_single_is_model
    model = load_model(state_dict['config'], **kwargs)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\utils\serialization.py", line 64, in load_model
    return model_class(**model_args)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\utils\serialization.py", line 39, in new_init
    init(self, *args, **kwargs)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\model\is_hrnet_model.py", line 13, in __init__
    super().__init__(norm_layer=norm_layer, **kwargs)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\model\is_model.py", line 59, in __init__
    cpu_mode=cpu_dist_maps, use_disks=use_disks)
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\model\ops.py", line 45, in __init__
    from isegm.utils.cython import get_dist_maps
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\utils\cython\__init__.py", line 2, in <module>
    from .dist_maps import get_dist_maps
  File "c:\Users\admin\Desktop\RITM\ritm_interactive_segmentation-main\isegm\utils\cython\dist_maps.py", line 3, in <module>
    from ._get_dist_maps import get_dist_maps
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 462, in load_module
    language_level=self.language_level)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 231, in load_module
    raise exc.with_traceback(tb)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 215, in load_module
    inplace=build_inplace, language_level=language_level)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyximport.py", line 191, in build_module
    reload_support=pyxargs.reload_support)
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
    dist.run_commands()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\dist.py", line 985, in run_command
    cmd_obj.run()
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\Cython\Distutils\old_build_ext.py", line 186, in run
    _build_ext.build_ext.run(self)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 340, in run
    self.build_extensions()
  File "c:\Users\admin\Desktop\RITM\venv\lib\site-packages\Cython\Distutils\old_build_ext.py", line 195, in build_extensions
    _build_ext.build_ext.build_extensions(self)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 449, in build_extensions
    self._build_extensions_serial()
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 474, in _build_extensions_serial
    self.build_extension(ext)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\command\build_ext.py", line 534, in build_extension
    depends=ext.depends)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python37\lib\distutils\_msvccompiler.py", line 426, in compile
    raise CompileError(msg)
ImportError: Building module isegm.utils.cython._get_dist_maps failed: ["distutils.errors.CompileError: command 'cl.exe' failed: No such file or directory\n"]

But cl.exe existson my running terminal,Could you give me some advice?

thanks