LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Machine Learning on LabVIEW


@n0psl0l0l wrote:

I tried to run on my friend's laptop, and it works fine without any error. But when I tried it on my laptop, it just crashed. I can't figure what it went wrong from the code, cause it runs pretty well on my friend's laptop. My friend was using the same version of LabVIEW and Python, for the specification of the laptop is Intel i5 8th Gen with 8 GB of RAM and he was using Windows 10


Ok, well that is soemthing to work with. Unfortunately this is the life of a software developer, figuring out why code works on one machine and not another. As long as you stick with LabVIEW this issue is reduced but as soon as you start calling other applications you take things into your own hands a bit but enough talking, there is a solution to your problem. You need to make two things match between you and your friends computer: 

1) your file system: (at least the files required by python and anything python calls) I saw an absolute path in the python code, that can/will mess you up and you need to fix that. Did you map the D drive onto your computer? Look for other absolute paths. 

 

2) your versions: you started down this path but for python you need to match versions for every module, not just python itself. This is not a hard requirement but if things are not working, this is often an issue. 

 

Fix those and this code has a much better chance of working. For debugging. Try calling the method in python to make sure it works before calling in LabVIEW, that way you will get a meaningful error message. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 11 of 14
(680 Views)

1. For the path mapping, I already changed the path based on my computer's path.

 

2. And for the version, I tried to match the library version that suits with Python 3.6.0 since it's the version I'm currently using. I'm using Tensorflow 2.6.2, Keras 2.6.0, Protobuf 3.19.6 (Since Protobuf is required when installing Tensorflow), and Numpy (1.19.5). For the LabVIEW I'm using LabVIEW 2018 64 Bit since I read in the NI that LabVIEW 2018 supports Python 3.6.0

0 Kudos
Message 12 of 14
(635 Views)

@n0psl0l0l wrote:

1. For the path mapping, I already changed the path based on my computer's path.

 

2. And for the version, I tried to match the library version that suits with Python 3.6.0 since it's the version I'm currently using. I'm using Tensorflow 2.6.2, Keras 2.6.0, Protobuf 3.19.6 (Since Protobuf is required when installing Tensorflow), and Numpy (1.19.5). For the LabVIEW I'm using LabVIEW 2018 64 Bit since I read in the NI that LabVIEW 2018 supports Python 3.6.0


Ok #1 sounds good. For #2 I'm not sure what you are telling me, do those versions match what is on your friends computer, because that is what you need? 

 

If so, its time to move on to the next step. What happens when you call the method directly from Python? Does it run? If it does not run what is the error? 

 

On a side note, Why are you using such old versions for everthing? Python 3.6 is End of Life and no longer supported. I'm not sure of your project but you can get LabVIEW 2023 CE for free for CE kinds of things. The latest versions of labview officially support up to Python 3.9 (and if you are creative you can call any version of Python you want from any version of LabVIEW)

 

Here are some useful links: 

 

https://www.jetbrains.com/pycharm/download/#section=mac

 

https://www.ni.com/en-us/support/downloads/software-products/download.labview.html#460283

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 13 of 14
(628 Views)

I tried to run the Python code on VSCode, and it doesn't show any error. Right now I'm just suspecting the Python, cause when I run the LabVIEW without Python, it works fine. It forces close when I put Python in it. It's just weird to me cause it runs smoothly in my friend's laptop even when I put my Python code in it

0 Kudos
Message 14 of 14
(609 Views)