Flavien 0 Posted August 11, 2022 Hi, I have a Python script that trains a TensorFlow model. Python is installed in a Conda environment. When the Python script is run from a command prompt, the model is trained on GPU. But when the script is run from Delphi PythonEngine, the model is trained on CPU instead. Would anyone has an idea why I am not able to use GPU with Python4Delphi? Thanks. Share this post Link to post
KoRiF 1 Posted August 11, 2022 (edited) the first thing that comes to mind is that some configuration settings are "lost" due to the fact that the current directory may be different (or some logic related to this is broken) also check this: https://www.tensorflow.org/guide/gpu you can do some diagnostic this way Edited August 11, 2022 by KoRiF Share this post Link to post
SwiftExpat 65 Posted August 11, 2022 Process monitor from Sysinternals is your friend here. Trace the startup and see where the file is not found. Python at the command prompt is built with vcruntime, and Delphi does not. Put a copy of msvcp140.dll and vcruntime140_1.dll in the directory that has your EXE and then see if works correctly. Share this post Link to post
Flavien 0 Posted August 12, 2022 Thank you for your advice. Despite using the same working directory, TensorFlow is indeed loading CUDA DLLs from a different location with Python4Delphi. Share this post Link to post
tomye 1 Posted October 16, 2022 On 8/12/2022 at 11:14 PM, Flavien said: Thank you for your advice. Despite using the same working directory, TensorFlow is indeed loading CUDA DLLs from a different location with Python4Delphi. i met a same problem like yours , have you fix it? Share this post Link to post
Flavien 0 Posted October 17, 2022 The wrong DLLs have been uninstalled from the computer so Delphi can only find the right ones and training is now performed on GPU. But if you need both DLLs, I guess you can fix it by modifying the order of the search path. Share this post Link to post
tomye 1 Posted October 17, 2022 32 minutes ago, Flavien said: The wrong DLLs have been uninstalled from the computer so Delphi can only find the right ones and training is now performed on GPU. But if you need both DLLs, I guess you can fix it by modifying the order of the search path. i fix it, due to a wrong version has been installed. 😞 Share this post Link to post
Trade Label Software 0 Posted January 20, 2023 I faced this problem but these are not solved so can you help me. Share this post Link to post
SendGroupSMS 0 Posted January 21, 2023 Please make sure you have entered the correct search path for both platforms to run your python script. Share this post Link to post