Giter VIP home page Giter VIP logo

Comments (6)

github-actions avatar github-actions commented on May 27, 2024

👋 Hello @pierrickBERTHE, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

from ultralytics.

glenn-jocher avatar glenn-jocher commented on May 27, 2024

It appears the issue is related to the directory path format you're using with MLflow. On Windows systems, it's recommended to use a forward slash (/) or double backslashes (\\) in paths.

Try modifying your MLflow tracking URI as follows:

mlflow.set_tracking_uri('file:./runs')
# or, if there's an issue with relative paths, try using the absolute path
mlflow.set_tracking_uri('file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs')

Ensure to replace 'C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs' with the correct absolute path to your project's tracking directory. This should resolve the UnsupportedModelRegistryStoreURIException you're encountering.

from ultralytics.

pierrickBERTHE avatar pierrickBERTHE commented on May 27, 2024

Hi,
I try with the absolute path but it doesn't work.

# folder of mlflow runs
folder_path = "C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs"

# Vérifier si le dossier existe
if os.path.isdir(folder_path):
    print("Folder exists.\n")
else:
    print("folder does not exist.\n")
    
# Déterminer l'URI de suivi MLflow 
input_uri = f'file:///{folder_path}'
mlflow.set_tracking_uri(input_uri)
print(f"URI de suivi MLflow : {input_uri}\n")

# Entrainer le modèle YOLO sur les données
model_yolo.train(
    data='data/cleaned',
    epochs=nb_epoch
)

It is the same issue with the Output:

Folder exists.

URI de suivi MLflow : file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs

And the error is always the same

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File c:\Users\pierr\VSC_Projects\Projet8_OCR_DataScientist\env\Lib\site-packages\mlflow\tracking\registry.py:80, in StoreRegistry.get_store_builder(self, store_uri)
     [79](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/env/Lib/site-packages/mlflow/tracking/registry.py:79) try:
---> [80](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/env/Lib/site-packages/mlflow/tracking/registry.py:80)     store_builder = self._registry[scheme]
     [81](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/env/Lib/site-packages/mlflow/tracking/registry.py:81) except KeyError:

KeyError: 'c'

To have a better understanding, I add :

print("print dans registry.py")
print("store_uri: ", store_uri)
print("scheme: ", scheme)

In the file registry.py of mlflow and the output is :

print dans registry.py
store_uri:  [c:\Users\pierr\VSC_Projects\Projet8_OCR_DataScientist\runs\mlflow](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs/mlflow)
scheme:  c

So I understand that mlflow parse my path and analyse the c of [c:\Users\pierr\VSC_Projects\Projet8_OCR_DataScientist\runs\mlflow](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs/mlflow) as a sheme. After it says that Supported URI schemes are: ['', 'file', 'databricks', 'databricks-uc', 'http', 'https', 'postgresql', 'mysql', 'sqlite', 'mssql']. So cdoesn't work.

Have you any other idea? Should I try to downgrade mlflow? Or any other test?
Thanks for your help.

from ultralytics.

pierrickBERTHE avatar pierrickBERTHE commented on May 27, 2024

I try with a bad folder path:

# folder of mlflow runs
folder_path = "bad_folder"

# Vérifier si le dossier existe
if os.path.isdir(folder_path):
    print("Folder exists.\n")
else:
    print("folder does not exist.\n")
    
# Déterminer l'URI de suivi MLflow 
input_uri = f'file:///{folder_path}'
mlflow.set_tracking_uri(input_uri)
print(f"URI de suivi MLflow : {input_uri}\n")

# Entrainer le modèle YOLO sur les données
model_yolo.train(
    data='data/cleaned',
    epochs=nb_epoch
)

and the output:

folder does not exist.

URI de suivi MLflow : file:///bad_folder

and the output of the print in registry.py:

print dans registry.py
store_uri:  [c:\Users\pierr\VSC_Projects\Projet8_OCR_DataScientist\runs\mlflow](file:///C:/Users/pierr/VSC_Projects/Projet8_OCR_DataScientist/runs/mlflow)
scheme:  c

So the lines before the train of model are not used by the train of Yolov8 model:

# Déterminer l'URI de suivi MLflow 
input_uri = f'file:///{folder_path}'
mlflow.set_tracking_uri(input_uri)
print(f"URI de suivi MLflow : {input_uri}\n")

Have you any suggestion of test please?

from ultralytics.

pierrickBERTHE avatar pierrickBERTHE commented on May 27, 2024

I found it!!

I'm not sure if it's a good practice, but I went ahead and directly modified the code in the file mlflow/tracking/registry.py in my env file. I added:

        print(
            "\nAjout code par PB dans mlflow/tracking/registry.py"
            )
        print("store_uri: ", store_uri)
        print("scheme: ", scheme)
        scheme = "file"
        print("PB a modifié la valeur de scheme")
        print("scheme: ", scheme, '\n')

and it gives me the following output:

print ajouté par PB dans registry.py
store_uri:  c:\Users\pierr\VSC_Projects\Projet8_OCR_DataScientist\runs\mlflow
scheme:  c
PB a modifié la valeur de scheme
scheme:  file 

So I tricked mlflow. I had to do the same trick in the file mlflow/store/artifact/artifact_repository_registry.py.

However, the mlflow ui deposit doesn't seem to work properly afterwards to retrieve the information. But it's not a problem for me because I just need to do a POC and access the accuracy results in \runs\classify\train and that's enough for me.
Thanks for your help anyway!

from ultralytics.

glenn-jocher avatar glenn-jocher commented on May 27, 2024

@pierrickBERTHE hi there! 🎉

Great to hear you found a workaround by modifying the mlflow source code for your POC. It's an inventive solution, although, typically, we advise against modifying library internals as it could potentially lead to unexpected behavior or issues with updates in the future.

For a more sustainable solution, consider submitting an issue or a feature request to the MLflow repository detailing this URI parsing challenge. It might benefit from a more permanent fix or improvement in their URI handling for Windows systems.

Thanks for sharing your experience, and good luck with your POC! If you need further assistance, feel free to reach out. 🚀

from ultralytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.