-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: module 'tensorflow' has no attribute 'trainable_variables' #14
Comments
What backend did you use? |
@lululxvi |
What backend did you use? |
I'm having a similar issue. Thanks! ...% DDEBACKEND=tensorflow.compat.v1 python3 deeponet_pde.py WARNING:tensorflow:From /[HOME-PATH]/.local/lib/python3.6/site-packages/tensorflow/python/compat/v2_compat.py:101: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Generating operator data... Generating operator data... Compiling model... 2022-01-28 13:40:35.658490: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 FMA Initializing variables... Step Train loss Test loss Test metric Best model at step 50: 'train' took 5.478015 s Traceback (most recent call last): |
Following [1], it seems that changing tf.trainable_variables() to tf.compat.v1.trainable_variables() would work. Now, getting "ValueError: The passed save_path is not a valid checkpoint: model/model.ckpt-43000" error in saver.py but that should not be related to tf.compat.v1.trainable_variables(). |
Do you have the file "model.ckpt-43000" in the folder "model"? |
@udemirezen @cfd-ai Note the code here requires DeepXDE v0.11.2, see https://github.com/lululxvi/deeponet#installation-guide New version of DeepXDE may require some modification of the code. We will release the DeepONet code for the new DeepXDE version soon. Check https://arxiv.org/abs/2111.05512 later |
deeponet_pde.py, line 173, change The problem can be solved. |
Traceback (most recent call last):
File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 285, in
main()
File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 281, in main
run(problem, system, space, T, m, nn, net, lr, epochs, num_train, num_test)
File "D:/Desktop/Codes/deeponet-master/deeponet-master/src/deeponet_pde.py", line 173, in run
print("# Parameters:", np.sum([np.prod(v.get_shape().as_list()) for v in tf.trainable_variables()]))
AttributeError: module 'tensorflow' has no attribute 'trainable_variables'
how to solve this error?
The text was updated successfully, but these errors were encountered: