Skip to content

Error with multiple GPUs: Do not use tf.reset_default_graph() to clear nested graphs #19

@neuro30

Description

@neuro30

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions