madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [madlib] kaknikhil commented on a change in pull request #522: DL: Remove keras dependency
Date Wed, 21 Oct 2020 00:54:28 GMT

kaknikhil commented on a change in pull request #522:
URL: https://github.com/apache/madlib/pull/522#discussion_r508925083



##########
File path: src/ports/postgres/modules/deep_learning/test/unit_tests/test_madlib_keras.py_in
##########
@@ -28,12 +28,13 @@ from os import path
 sys.path.append(path.dirname(path.dirname(path.dirname(path.dirname(path.abspath(__file__))))))
 sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))))
 
-import keras
-from keras.models import *
-from keras.layers import *
 import unittest
 from mock import *
 import plpy_mock as plpy
+
+from tensorflow import keras
+from tensorflow.keras.models import *
+from tensorflow.keras.layers import *

Review comment:
       Because of these imports, the `__name__` variable changes from __main__ to ` from tensorflow.keras.layers
import *` which makes it so that none of the tests get run.
   Looks like this is a bug in tf 1.14 (which has been fixed in 2.0)
   
   A quick way to fix this would be to move these imports to inside the `if __name__ == '__main__'`
code block. 
   
   This probably won't be a problem for our source code since we don't depend on the `__name__`
variable but we should at least look into it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message