MIDASpy
MIDASpy copied to clipboard
Error with multiple GPUs: Do not use tf.reset_default_graph() to clear nested graphs
I am trying to utilize two GPUs with MIDASpy. However, I get the following error during set-up:
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import pandas as pd
import tensorflow as tf
import MIDASpy as md
data_0 = pd.read_csv('/home/comp/Documents/file.txt', sep = "\t")
data_0.columns.str.strip()
data_0 = data_0.set_index('Unnamed: 0')
data_0.index.names = [None]
np.random.seed(441)
na_loc = data_0.isnull()
data_0[na_loc] = np.nan
imputer = md.Midas(layer_structure= [256, 256, 256],
learn_rate= 1e-4,
input_drop= 0.9,
train_batch = 50,
savepath= '/home/comp/Documents/save',
seed= 89)
strategy = tf.distribute.MirroredStrategy()
with strategy.scope():
imputer.build_model(data_0)
AssertionError: Do not use tf.reset_default_graph() to clear nested graphs. If you need a cleared graph, exit the nesting and create a new graph.
Hi @neuro30, thanks for sharing this. Multi-GPU support is not currently available for MIDASpy unfortunately. You should be able to get single-GPU support working if CUDA is properly configured for tensorflow.
We are considering ways of adding multi-GPU support in the future.