[Python] Python - installing package using setuptools (setup.py) on AzureML

Discussão em 'Python' iniciado por Stack, Abril 1, 2025.

  1. Stack

    Stack Membro Participativo

    I'm currently working on a project where I try to implement DINO:DETR (https://github.com/IDEA-Research/DINO) on AzureML to train a model with it. I've succesfully created an environment with CUDA 11.3 and torch 1.12.0 and this environment is succesfully compiled. Step 4 of the installation guide is installing the package using a setup.py file (to install MultiScaleDeformableAttention):

    python setup.py build install


    First question: Is it possible to install this setup.py in the environment (stc-cuda-env) directly?

    The method I used now if using subprocess in the main.py file to install this setup.py directly to the compute.

    subprocess.run(["python", "setup.py", "build", "install"])


    I can find the following information in my logfile, which indicates that the installation was succesfull:

    Installed /opt/conda/envs/ptca/lib/python3.8/site-packages/MultiScaleDeformableAttention-1.0-py3.8-linux-x86_64.egg Processing dependencies for MultiScaleDeformableAttention==1.0 Finished processing dependencies for MultiScaleDeformableAttention==1.0

    When MultiScaleDeformableAttention is imported (either manually or in the code function build_model_main()) I get the following error: ModuleNotFoundError: No module named 'MultiScaleDeformableAttention'

    Second question: How can I succesfully import/install the package on AzureML?

    BTW: I checked whether GPU is available using and the output is True

    print(torch.cuda.is_available())

    Continue reading...

Compartilhe esta Página