Skip to content
Snippets Groups Projects
Commit 0cd438ca authored by carlosuc3m's avatar carlosuc3m
Browse files

finally adapt manager to new JSON

parent 9947ce38
No related branches found
No related tags found
No related merge requests found
package plugins.danyfel80.deeplearningdownloader;
import java.awt.event.ActionListener;
import java.awt.event.WindowListener;
import java.io.IOException;
import java.util.Map;
......@@ -42,8 +41,9 @@ public class DeepLearningVersionSelector extends EzPlug implements EzStoppable,
{
versions = AvailableDeepLearningVersions.loadCompatibleOnly().getVersions().stream()
.collect(Collectors.toMap(
v -> v.getEngine() + "-" + v.getPythonVersion() + "-"
+ (v.getMode().toLowerCase().equals("cpu") ? "cpu" : "cpu-gpu"),
v -> v.getEngine() + "-" + v.getPythonVersion()
+ (v.getCPU() ? "-" + DeepLearningVersion.cpuKey : "")
+ (v.getGPU() ? "-" + DeepLearningVersion.gpuKey : ""),
Function.identity()));
}
......@@ -120,18 +120,21 @@ public class DeepLearningVersionSelector extends EzPlug implements EzStoppable,
DeepLearningVersion version = versions.get(targetVersion);
try
{
notifyProgress(Double.NaN, "Loading TensorFlow " + version.getVersion() + "-" + version.getOs() + "-"
+ version.getMode() + "...");
notifyProgress(Double.NaN, "Loading TensorFlow " + version.getVersion() + "-" + version.getOs()
+ (version.getCPU() ? "-" + DeepLearningVersion.cpuKey : "")
+ (version.getGPU() ? "-" + DeepLearningVersion.gpuKey : "") + "...");
LibraryLoadingStatus status = DeepLearningDownloader.loadLibrary(version, false,
(p, t) -> notifyProgress(p / t,
"Loading TensorFlow " + version.getVersion() + "-" + version.getOs() + "-"
+ version.getMode() + "..."));
if (status.getStatus().equals(LibraryLoadingStatus.ERROR_LOADING))
"Loading TensorFlow " + version.getVersion() + "-" + version.getOs()
+ (version.getCPU() ? "-" + DeepLearningVersion.cpuKey : "")
+ (version.getGPU() ? "-" + DeepLearningVersion.gpuKey : "") + "..."));
if (status.getStatus().equals(LibraryLoadingStatus.ERROR_LOADING)) {
notifyError("Error loading TensorFlow: " + status.getMessage());
else
notifyInfo("Loaded: version=" + version.getVersion() + ", mode=" + version.getMode()
+ ", for TF version=" + version.getPythonVersion());
} else {
notifyInfo("Loaded: version=" + version.getVersion() + ", cpu=" + version.getCPU()
+ ", gpu=" + version.getGPU() + ", for TF version=" + version.getPythonVersion());
}
if (!isHeadLess())
this.getUI().close();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment