PyGlow icon indicating copy to clipboard operation
PyGlow copied to clipboard

AttributeError: module 'glow.metrics' has no attribute 'get'

Open dexterdev opened this issue 4 years ago • 0 comments

I was running the test code in the page https://pyglow.github.io/ on google colab. It gave me this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-0ea5fc0ad3bd> in <module>()
     35 
     36 # train the model along with calculating dynamics
---> 37 model.fit_generator(train_loader, val_loader, num_epochs)

2 frames
/usr/local/lib/python3.7/dist-packages/glow/models/network.py in fit_generator(self, train_loader, val_loader, num_epochs, show_plot)
    291 
    292         """
--> 293         self.training_loop(num_epochs, train_loader, val_loader, show_plot)
    294 
    295     def predict(self, x):

/usr/local/lib/python3.7/dist-packages/glow/models/network.py in training_loop(self, num_epochs, train_loader, val_loader, show_plot)
    181         train_len = len(train_loader)
    182         val_len = len(val_loader)
--> 183         metric_dict = self.handle_metrics(self.metrics)
    184         epoch_collector = []
    185         for epoch in range(num_epochs):

/usr/local/lib/python3.7/dist-packages/glow/models/network.py in handle_metrics(self, metrics)
    134         metric_dict = {}
    135         for metric in metrics:
--> 136             metric_fn = metric_module.get(metric)  # returns the function
    137             metric_dict[metric] = metric_fn
    138 

AttributeError: module 'glow.metrics' has no attribute 'get'

I don't understand what to do about this.

dexterdev avatar Jul 28 '21 06:07 dexterdev