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

Installation error #364

Open
codaubianca opened this issue Aug 3, 2022 · 4 comments
Open

Installation error #364

codaubianca opened this issue Aug 3, 2022 · 4 comments
Assignees
Labels
kind/bug something isn't working priority/P0 highest priority
Milestone

Comments

@codaubianca
Copy link

I want to use the mmgen module in my own project but I have been struggling with the installation. I couldn't find any issues on the topic. Any help is greatly appreciated.

Describe the bug
First, I have tried to install the mmgen module by following the steps in the get_started tutorial. However, when running the following command in Step 1:

pip install -v -e .

I get the following error and the installation is interrupted:

Installing collected packages: mmgen
  Running setup.py develop for mmgen
    Running command python setup.py develop
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 173, in <module>
        add_mim_extension()
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 159, in add_mim_extension 
        os.symlink(src_relpath, tar_path)
    OSError: [WinError 1314] A required privilege is not held by the client: '..\\..\\tools' -> 'D:\\Work\\FZI\\TKS\\workspace\\adversarial_traffic_signs\\mmgeneration\\mmgen\\.mim\\tools'

In a second attempt, I have tried to install mmgen as a dependency, as described in case b, with:

pip install mmgen

In this case, the installation is completed but I get another error when simply importing the mmgen module in my project.
When I run the following code line:

from mmgen.apis import init_model, sample_conditional_model

I get the following error:

ModuleNotFoundError                       Traceback (most recent call last)
d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\src\pretrained_gan_comparison.ipynb Cell 2 in <cell line: 10>()
      [7](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=6) from pytorch_pretrained_biggan import BigGAN, one_hot_from_names, truncated_noise_sample, save_as_images, display_in_terminal
      [9](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=8) # Open-MMLab models:
---> [10](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=9) from mmgen.apis import init_model, sample_conditional_model

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\__init__.py:2, in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .inference import (init_model, sample_conditional_model,
      3                         sample_ddpm_model, sample_img2img_model,
      4                         sample_unconditional_model)
      5 from .train import set_random_seed, train_model
      7 __all__ = [
      8     'set_random_seed', 'train_model', 'init_model', 'sample_img2img_model',
      9     'sample_unconditional_model', 'sample_conditional_model',
     10     'sample_ddpm_model'
     11 ]

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\inference.py:9, in <module>
      6 from mmcv.utils import is_list_of
      8 from mmgen.datasets.pipelines import Compose
----> 9 from mmgen.models import BaseTranslationModel, build_model
     12 def init_model(config, checkpoint=None, device='cuda:0', cfg_options=None):
     13     """Initialize a detector from config file.
...
     17                                          EqualLinearActModule,
     18                                          ModMBStddevLayer, ModulatedStyleConv,
     19                                          ModulatedToRGB, ResBlock)

ModuleNotFoundError: No module named 'mmgen.models.architectures.stylegan.ada'

I have noticed that when installing mmgen via pip then the 'mmgen.models.architectures.stylegan.ada' module is not downloaded at all.

I have installed mmcv-full version 1.5.0 and other required dependencies in the local python environment I use for my project.

@LeoXing1996
Copy link
Collaborator

I will attempt to reproduce your error on windows.
You can add 'mmgen' to PYTHON_PATH for a temporary solution. Then you can use it like it has already been installed.

@LeoXing1996 LeoXing1996 self-assigned this Aug 3, 2022
@IceClear
Copy link

The same problem on Ubuntu using pip install mmgen. There should be some bugs in the init file.

@zengyh1900 zengyh1900 added kind/bug something isn't working awaiting response priority/P0 highest priority labels Oct 12, 2022
@zengyh1900 zengyh1900 added this to the 0.8.0 milestone Oct 12, 2022
@lyzla
Copy link

lyzla commented Nov 8, 2022

I want to use the mmgen module in my own project but I have been struggling with the installation. I couldn't find any issues on the topic. Any help is greatly appreciated.

Describe the bug First, I have tried to install the mmgen module by following the steps in the get_started tutorial. However, when running the following command in Step 1:

pip install -v -e .

I get the following error and the installation is interrupted:

Installing collected packages: mmgen
  Running setup.py develop for mmgen
    Running command python setup.py develop
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 173, in <module>
        add_mim_extension()
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 159, in add_mim_extension 
        os.symlink(src_relpath, tar_path)
    OSError: [WinError 1314] A required privilege is not held by the client: '..\\..\\tools' -> 'D:\\Work\\FZI\\TKS\\workspace\\adversarial_traffic_signs\\mmgeneration\\mmgen\\.mim\\tools'

In a second attempt, I have tried to install mmgen as a dependency, as described in case b, with:

pip install mmgen

In this case, the installation is completed but I get another error when simply importing the mmgen module in my project. When I run the following code line:

from mmgen.apis import init_model, sample_conditional_model

I get the following error:

ModuleNotFoundError                       Traceback (most recent call last)
d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\src\pretrained_gan_comparison.ipynb Cell 2 in <cell line: 10>()
      [7](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=6) from pytorch_pretrained_biggan import BigGAN, one_hot_from_names, truncated_noise_sample, save_as_images, display_in_terminal
      [9](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=8) # Open-MMLab models:
---> [10](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=9) from mmgen.apis import init_model, sample_conditional_model

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\__init__.py:2, in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .inference import (init_model, sample_conditional_model,
      3                         sample_ddpm_model, sample_img2img_model,
      4                         sample_unconditional_model)
      5 from .train import set_random_seed, train_model
      7 __all__ = [
      8     'set_random_seed', 'train_model', 'init_model', 'sample_img2img_model',
      9     'sample_unconditional_model', 'sample_conditional_model',
     10     'sample_ddpm_model'
     11 ]

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\inference.py:9, in <module>
      6 from mmcv.utils import is_list_of
      8 from mmgen.datasets.pipelines import Compose
----> 9 from mmgen.models import BaseTranslationModel, build_model
     12 def init_model(config, checkpoint=None, device='cuda:0', cfg_options=None):
     13     """Initialize a detector from config file.
...
     17                                          EqualLinearActModule,
     18                                          ModMBStddevLayer, ModulatedStyleConv,
     19                                          ModulatedToRGB, ResBlock)

ModuleNotFoundError: No module named 'mmgen.models.architectures.stylegan.ada'

I have noticed that when installing mmgen via pip then the 'mmgen.models.architectures.stylegan.ada' module is not downloaded at all.

I have installed mmcv-full version 1.5.0 and other required dependencies in the local python environment I use for my project.

Have you found a solution?I have the same problem as you.

@IceClear
Copy link

IceClear commented Nov 8, 2022

I want to use the mmgen module in my own project but I have been struggling with the installation. I couldn't find any issues on the topic. Any help is greatly appreciated.
Describe the bug First, I have tried to install the mmgen module by following the steps in the get_started tutorial. However, when running the following command in Step 1:

pip install -v -e .

I get the following error and the installation is interrupted:

Installing collected packages: mmgen
  Running setup.py develop for mmgen
    Running command python setup.py develop
    Traceback (most recent call last):
      File "<string>", line 2, in <module>
      File "<pip-setuptools-caller>", line 34, in <module>
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 173, in <module>
        add_mim_extension()
      File "D:\Work\FZI\TKS\workspace\adversarial_traffic_signs\mmgeneration\setup.py", line 159, in add_mim_extension 
        os.symlink(src_relpath, tar_path)
    OSError: [WinError 1314] A required privilege is not held by the client: '..\\..\\tools' -> 'D:\\Work\\FZI\\TKS\\workspace\\adversarial_traffic_signs\\mmgeneration\\mmgen\\.mim\\tools'

In a second attempt, I have tried to install mmgen as a dependency, as described in case b, with:

pip install mmgen

In this case, the installation is completed but I get another error when simply importing the mmgen module in my project. When I run the following code line:

from mmgen.apis import init_model, sample_conditional_model

I get the following error:

ModuleNotFoundError                       Traceback (most recent call last)
d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\src\pretrained_gan_comparison.ipynb Cell 2 in <cell line: 10>()
      [7](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=6) from pytorch_pretrained_biggan import BigGAN, one_hot_from_names, truncated_noise_sample, save_as_images, display_in_terminal
      [9](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=8) # Open-MMLab models:
---> [10](vscode-notebook-cell:/d%3A/Work/FZI/TKS/workspace/adversarial_traffic_signs/src/pretrained_gan_comparison.ipynb#ch0000001?line=9) from mmgen.apis import init_model, sample_conditional_model

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\__init__.py:2, in <module>
      1 # Copyright (c) OpenMMLab. All rights reserved.
----> 2 from .inference import (init_model, sample_conditional_model,
      3                         sample_ddpm_model, sample_img2img_model,
      4                         sample_unconditional_model)
      5 from .train import set_random_seed, train_model
      7 __all__ = [
      8     'set_random_seed', 'train_model', 'init_model', 'sample_img2img_model',
      9     'sample_unconditional_model', 'sample_conditional_model',
     10     'sample_ddpm_model'
     11 ]

File d:\Work\FZI\TKS\workspace\adversarial_traffic_signs\env\lib\site-packages\mmgen\apis\inference.py:9, in <module>
      6 from mmcv.utils import is_list_of
      8 from mmgen.datasets.pipelines import Compose
----> 9 from mmgen.models import BaseTranslationModel, build_model
     12 def init_model(config, checkpoint=None, device='cuda:0', cfg_options=None):
     13     """Initialize a detector from config file.
...
     17                                          EqualLinearActModule,
     18                                          ModMBStddevLayer, ModulatedStyleConv,
     19                                          ModulatedToRGB, ResBlock)

ModuleNotFoundError: No module named 'mmgen.models.architectures.stylegan.ada'

I have noticed that when installing mmgen via pip then the 'mmgen.models.architectures.stylegan.ada' module is not downloaded at all.
I have installed mmcv-full version 1.5.0 and other required dependencies in the local python environment I use for my project.

Have you found a solution?I have the same problem as you.

I think currently the only solution is to install from the source rather than pip install and modify the related part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug something isn't working priority/P0 highest priority
Projects
None yet
Development

No branches or pull requests

5 participants