GrievingTurkey78
maybe since the package is not directly imported in my code it is possible to get a different version to what I have locally (?).
If these are derivative packages (i.e. imported by other packages) they are not automatically logged when executing the Task manually (in order to keep the "installed packages as lean as possible on the one hand but specify also specify the important packages for you)
That said, when the "trains-agent" executed the task it will store nack the entire venv it created, including the derivative packages.
This might cause the difference in package version, as the "trains-agent "'s pip install will pick the latest derivative packages (based on the restrictions of the selected ones)
The
Task.add_requirements(package_name, package_version=None)
workaround works perfectly!
Great!
Yes, definitely a force flag could help or using the
requirements.txt
as the rule of thumb for packages and versions.
If you need you can tell trains to store your entire venv:
set detect_with_pip_freeze: true
in trains.conf
https://github.com/allegroai/trains/blob/b2c830f34e0df1cf127c16526a93523c1da66cb4/docs/trains.conf#L169
If it helps, the next trains-agent will have an additional flag to ignore the "installed packages" section and only use the "requirements.txt" from the repo