Closed gorkamunoz closed 6 months ago
I'm hesitant to change environment variables during import of deeptrack. First, it would forcibly overwrite any settings the user has set themselves. Second, it would only work if the default behavior is to silence the warnings, which I also hesitate to do. The only way to let the user configure the behavior of the import of deeptrack not to silence the warnings would be through another environment variable. At that point, one may as well just use the tensorflow variable.
However, I'm currently planning on deferring the import of tensorflow internally until it is used. The goal is to speed up the initial import of deeptrack. However, it can also make it possible to silence tensorflow. For example
import deeptrack as dt
dt.config.silence_warnings()
It is not a small amount of work to implement however, so I'd suspect it will not be implemented in the near future. I'd keep using the environment variable for now.
Perhaps I can catch the warnings and add a line on how to silence them?
If you have any other ideas, I'm open to suggestions. I also find the warnings irritating.
Hi! I understand your point, I think you are right about it. Also, deferring the import of Tensorflow would really help. I guess it is only used for the ML part of deeptrack? For instance, I was reluctant of putting deeptrack in the requirements of ANDI because it automatically installs tensorflow, which is usually quite heavy, and we don't use any tensorflow function (that I know, you may know better). Nonetheless, I guess you want to keep tensorflow in the requirements of deeptrack?
I completely understand that. In fact, we are currently working on separating deeptrack from tensorflow. We are moving to PyTorch due to tensorflow's abandonment of windows. The new integration with PyTorch will be through a separate package, as to not bloat deeptrack. Once this is complete, we can consider moving tensorflow to an optional dependency.
@giovannivolpe @JesusPinedaC what do you think?
Yes, I agree. The warnings are unfortunate, but they should be solved once we have completed the revision as outlined by Benjamin.
Hi! Is there a way to prevent the warnings below from appearing? I understand that you may want to keep the
cupy
warning. The rest is due to Tensorflow, which in my case happens because I use a CUDA version not yet supported by Tensorflow.There is an easy workaround, as explained here. You just need to add the following before importing
tensorflow
:I added this to my code, but maybe you want to add something similar directly in deeptrack? Just to note, the version of
tensorflow
that I have was automatically installed when installingdeeptrack
.