Open ablaom opened 5 months ago
@pebeto Can you reproduce?
Hi @ablaom
This is happening due to a limitation implemented in MLFlowClient.jl
. To make it working, you need to define an artifact_location
in your Logger
instance. I think I can solve this issue, but it belongs to the previously mentioned package (not here).
I'm actually pairing the library with the last mlflow
version in a branch (which solves a lot of problems related to this), but it will take time. I will reference this issue in MLFlowClient.jl
.
I am arriving here via https://github.com/JuliaAI/MLFlowClient.jl/issues/48, but I think that this issue describes better my situation, only that for me, it is using MLFlowClient.jl
, not MLJFlow.jl
.
I am using MLFlow version 2.7.1 If I remember correctly, I installed it from the conda-forge via Micromamba. I could double-check this. From the Julia side, I am using Julia 1.10 and MLFlowClient v0.5.1.
I start mlflow server
(with defaults) from the same location where I then call MLFlowClient. I download this sample image (https://github.com/JuliaLang/julia-logo-graphics/blob/master/images/fontsample.png) to have an artifact to log, and I put it in the same location too. Then, I do
using MLFlowClient
mlf = MLFlow("http://localhost:5000/api")
experiment = createexperiment(mlf)
run = createrun(mlf, experiment)
logartifact(mlf, run, "fontsample.png")
updaterun(mlf, run, "FINISHED")
With this, fontsample.png
is copied to
mlflow-artifacts:/472704068679330635/9c9008427165430f92c0a81c53f55d44/artifacts/fontsample.png
where 472704068679330635
is the name assigned to the experiment (I didn't choose one) and 9c9008427165430f92c0a81c53f55d44
is the id of the run. That is to say, the artifact is nicely identified by this path.
However, MLFlow doesn't know about this artifact. Through the API, I get an empty vector
julia> listartifacts(mlf::MLFlow, run)
Union{MLFlowArtifactDirInfo, MLFlowArtifactFileInfo}[]
and on the UI too
Since I am running MLFlow and MLFlowClient from the same location, I wouldn't have thought that the problem has to do with the default location of the artifacts, as addressed in https://github.com/JuliaAI/MLFlowClient.jl/issues/48. Or has it?
Hi @andreuvall. This issue is happening because of the way MLFlow
is handling with artifacts default directory (IMO, it's a horrible one). I don't remember the exact way, but in some of my tests, the REST API is not able to get the mlflow-artifacts
because it is out of scope (i.e. mlflow ui
is run outside the Julia project directory).
One of the solutions I proposed was to let MLFlowClient.jl
set a custom default directory ALWAYS. However, some of my tests were throwing some errors.
I'm very busy right now to get into it, but this is one of my priorities for this project.
Thank you, @pebeto, for your quick reply!
One of the solutions I proposed was to let MLFlowClient.jl set a custom default directory ALWAYS. However, some of my tests were throwing some errors.
I don't understand why this would help, but this may well be because I don't know the internals. For me this is not an urgent matter, and unfortunately I also don't have much time available, but if you can provide a couple of pointers for me to get to understand this better, I will at least give it a look.
Any updates on this? I recall uploading artifacts worked and it does not now. I also can't see logged artifacts.
This used to work for me but doesn't any longer. What's strange is that tests successfully pass locally for me, and I believe saving artifacts is in the tests.
Following the instructions in the README.md: