clearml
clearml copied to clipboard
import other .py's funtion error
hello,i am coming again ^_^
when i run a py file through the clearml-agent remotely,it failed because the agent can‘t find the function in this py file from another py file,should I can only write all the function in my run’s py file?is there some way that i can excute the code in a project
the following is my code and the error
the agent can‘t find the dataset py file。
looking forward to your reply thanks
Hi @rui1998,
I see you're using a single file and not a Git Repository, in which case ClearML will only record the single file in the uncommitted changes section, and the agent will only be able to restore the single file and run it when executing the task remotely.
In such a case, you cannot refer to other files in your directory structure, so you can either put your entire code in a single file, or use a Git repository 🙂
@jkhenning thanks, i will try
hello @jkhenning ,are there some document about use the Git in clearml? thanks for telling,
@rui1998
Git information is automatically stored once a file, in a git repository calls Task.init().
Is there any specific information you're referring to?
@erezalg hi ,you mean i dont have to do some other setting? i dont know how i set config in clearml.conf,can you tell me
Hi @rui1998, There isn't really a configuration you need to make for it to work. Are you trying to do something specific and are failing to do it? Here is the documentation of the conf file, you can review it and see if something is missing. https://clear.ml/docs/latest/docs/configs/clearml_conf
@erezalg the problem i met was when i excuted a .py file remotely through the clearml-agent ,it failed,because in this py file i import other py's function,someone told me use a git repositary to solve this,so i wanna ask if i just set the following config in the red box that can solve my problem?
i just set these config will solve my problem?
@rui1998 If you set the git_user and git_pass on the machine running the agent, and if the agent's machine has access to the git (IE, it's stored on github or bitbucket or locally on a git repo the machine has access to) it would work.
If you put it on a public repository you don't even have to fill the git_user and git_pass as they are not needed.
Does it make sense?
@erezalg thanks i undestand,
@erezalg @jkhenning sorry to bather you again, i use git but the problem didnt solve,
actually,i didt know how to fill the red box config in the following picture,there are two things Git and gitee, i use Git to initialize the project,
and i push the project in to the gitee(like Github, a platform) ,then i run the code in my computer, when the agent excute this code,the error appear,
and i found the agent just run the single file
@rui1998 when running the original (development) task, you need to run it from your git repository, OR you can update the git repository details in the task using the UI - otherwise the agent will not know what to check out when running the task
@jkhenning can you tell the details about how to run the file from my git repository
,i thought that i just set the clearml.conf can work it out before
@jkhenning or where to set the git repository details in the task using the UI ,thanks a lot, many people will use the agent in my company so i should make it clearly,thank you for telling again
Hey @rui1998 The repo details are auto logged when you init your task. The repo is the one binded to your script's running directory.
@erezalg @DavidNativ @jkhenning thank you everyone whose helped me ,i use git successfully