waleedka / hiddenlayer

Neural network graphs and training metrics for PyTorch, Tensorflow, and Keras.
MIT License
1.78k stars 265 forks source link

build_graph() does not return #90

Open buttercutter opened 2 years ago

buttercutter commented 2 years ago

I tried to use hiddenlayer on this network architecture search coding for the following search architecture, however the code could not exit and is inside build_graph() forever.

image

buttercutter commented 2 years ago

I used this hl.build_graph(graph(train_inputs), torch.zeros([1, 3, 32, 32]).cuda()) instead and hiddenlayer gave me the following error:

Traceback (most recent call last):
  File "/home/phung/PycharmProjects/beginner_tutorial/gdas.py", line 793, in <module>
    ltrain = train_NN(forward_pass_only=0)
  File "/home/phung/PycharmProjects/beginner_tutorial/gdas.py", line 429, in train_NN
    hl.build_graph(graph(train_inputs), torch.zeros([1, 3, 32, 32]).cuda())
  File "/usr/lib/python3.9/site-packages/hiddenlayer/graph.py", line 148, in build_graph
    raise ValueError("`model` input param must be a PyTorch, TensorFlow, or Keras-with-TensorFlow-backend model.") 
ValueError: `model` input param must be a PyTorch, TensorFlow, or Keras-with-TensorFlow-backend model.
dasdristanta13 commented 2 years ago

I think within the graph() you should not pass the train_inputs. Try without giving the train_inputs, i.e, try this instead, hl.build_graph(graph(), torch.zeros([1, 3, 32, 32]).cuda())