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

pip install mmseg fails when building docker image of related repo (mmdetection3d) #561

Closed
JSchuurmans opened this issue May 19, 2021 · 2 comments

Comments

@JSchuurmans
Copy link

Checklist

  1. I have searched related issues but cannot get the expected help. Yes
  2. The bug has not been fixed in the latest version. No

Describe the bug
Docker cannot build the image. RUN pip install mmseg fails. It looks like a python 2 vs 3 incompatibility. See Error traceback and Bug fix.

Reproduction

  1. What command or script did you run?
docker build -t mmdetection3d docker/
  1. Did you make any modifications on the code or config? No

Environment

Docker

Error traceback

Step 11/19 : RUN pip install mmseg
 ---> Running in 798c6d89b234
Collecting mmseg
  Downloading mmseg-1.3.0.tar.gz (817 kB)
    ERROR: Command errored out with exit status 1:
     command: /opt/conda/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ofv4t21p/mmseg/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ofv4t21p/mmseg/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-ofv4t21p/mmseg/pip-egg-info
         cwd: /tmp/pip-install-ofv4t21p/mmseg/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-ofv4t21p/mmseg/setup.py", line 6, in <module>
        reload(sys)
    NameError: name 'reload' is not defined
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
The command '/bin/sh -c pip install mmseg' returned a non-zero code: 1

Bug fix
Comment out the line that errors. This is not a fix, more like a workaround...

# RUN pip install mmseg

I found the following on https://www.programmersought.com/article/91541059533/ .
ForPython 2.X:

import sys
reload(sys)
sys.setdefaultencoding("utf-8")

For >=Python 3.4:

import importlib
importlib.reload(sys)
@xvjiarui
Copy link
Collaborator

Hi @JSchuurmans
Is the error exists if you are not installing in docker?

@Wuziyi616
Copy link
Contributor

@xvjiarui @JSchuurmans I think this bug is solved in open-mmlab/mmdetection3d#563 (comment) because mmdet3d uses a wrong name for mmseg installation (which should be mmsegmentation rather than mmseg). Can close this issue?

aravind-h-v pushed a commit to aravind-h-v/mmsegmentation that referenced this issue Mar 27, 2023
* add CLIPGuidedStableDiffusion

* add credits

* add readme

* style

* add clip prompt

* fnfix cond_n

* fix cond fn

* fix cond fn for lms
wjkim81 pushed a commit to wjkim81/mmsegmentation that referenced this issue Dec 3, 2023
* add demos in readme

* update readme

* cat-id to det-cat-id

* add demo in README

* rename demo name
sibozhang pushed a commit to sibozhang/mmsegmentation that referenced this issue Mar 22, 2024
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

3 participants