From 770deff0226fef098f9ca223aa56a4f45a7f1451 Mon Sep 17 00:00:00 2001 From: N00MKRAD Date: Thu, 10 Dec 2020 17:59:11 +0100 Subject: [PATCH] Open python installation page if module is missing --- Code/OS/AiProcess.cs | 2 ++ Code/OS/Pytorch.cs | 7 ++++++- PythonDependencies.md | 8 +++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Code/OS/AiProcess.cs b/Code/OS/AiProcess.cs index 8a62cab..11f13e9 100644 --- a/Code/OS/AiProcess.cs +++ b/Code/OS/AiProcess.cs @@ -270,6 +270,8 @@ namespace Flowframes { hasShownError = true; InterpolateUtils.ShowMessage($"A python module is missing.\nCheck {logFilename} for details.\n\n{line}\n\nIf you don't want to install it yourself, use the Python package from the Package Installer.", "Error"); + if(!Pytorch.HasEmbeddedPyFolder()) + Process.Start("https://github.com/n00mkrad/flowframes/blob/main/PythonDependencies.md"); } if (!hasShownError && line.ToLower().Contains("no longer supports this gpu")) diff --git a/Code/OS/Pytorch.cs b/Code/OS/Pytorch.cs index 9169a9c..a1db6e1 100644 --- a/Code/OS/Pytorch.cs +++ b/Code/OS/Pytorch.cs @@ -14,7 +14,7 @@ namespace Flowframes.OS public static string GetPyCmd () { - if (Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-tu")) || Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-ampt"))) + if (HasEmbeddedPyFolder()) { Logger.Log("Using embedded Python runtime."); string pyPkgDir = Path.Combine(Paths.GetPkgPath(), "py-amp"); @@ -39,6 +39,11 @@ namespace Flowframes.OS return ""; } + public static bool HasEmbeddedPyFolder () + { + return Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-tu")) || Directory.Exists(Path.Combine(Paths.GetPkgPath(), "py-ampt")); + } + public static bool IsPytorchReady () { string torchVer = GetPytorchVer(); diff --git a/PythonDependencies.md b/PythonDependencies.md index 565cc82..fb68e5d 100644 --- a/PythonDependencies.md +++ b/PythonDependencies.md @@ -7,4 +7,10 @@ -This should be sufficient to run RIFE and other Pytorch-based networks on any modern GPU, including the RTX 3000 (Ampere) series. \ No newline at end of file +This should be sufficient to run RIFE and other Pytorch-based networks on any modern GPU, including the RTX 3000 (Ampere) series. + +## Troubleshooting + +If you are getting some kind of numpy error, try downgrading it to 1.19.3: + +`pip install numpy==1.19.3` \ No newline at end of file