09-18-2023 09:58 PM
Hi my name is Leo,
I have this project about YOLO detection that i've been working on and i had to call out python code from labview. Long story short it was successful, but the problem is that i had to call out this python script in every iteration which caused the memory to pile up and eventually crash on my computer. I've read some of the QnA here and there that some use shift registration and other use new data value reference then delete the data value reference. I'm not sure how to apply those function here
The picture above is part of my big project and caused the memory to pile up.
the picture above is the result of the run which pile up the memory
Is this because of the python code or do i need to add a function in labview
what do you guys think?
sincerely
Leo
09-19-2023 04:13 AM
for a start, I would try to move the"open virtual environment session.vi" and "close python session" outside of the while loop
09-20-2023 01:11 AM
Hello Alex
I've tried that it works but it only works for the first time but not for the next iteration 😞 is there a way to erase the python memory?
09-20-2023 08:07 AM
@Leonard555 wrote:
is there a way to erase the python memory?Is this because of the python code or do i need to add a function in labview
what do you guys think?
As far as I know there is no "release memory" function available for the labview python node.
But if your .vi is piling up resources - increasing each while loop iteration - there is probably room for optimization in the .vi and/or the .py
09-21-2023 03:17 AM
I see, thank you for the suggestion alex. ill try to work on the .vi and the .py. But if there is another solution, feel free to share.
Cheers,
Leo