Skip to content
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

Trouble using dense_layers argument #2

Open
chriskok opened this issue Feb 25, 2021 · 3 comments
Open

Trouble using dense_layers argument #2

chriskok opened this issue Feb 25, 2021 · 3 comments

Comments

@chriskok
Copy link

Hi! I've recently been hyperparameter tuning for the OCMAML algorithm on the MNIST dataset and I ran into this error when trying to use the dense_layers argument:

Traceback (most recent call last):
File "main.py", line 640, in
main(args)
File "main.py", line 313, in main
model = MAML(sess, args, seed, n_train_tasks, input_shape)
File "/media/nvidia/DATA1/MUHB/Few-Shot-One-Class-Classification-via-Meta-Learning/MAMLs_Reptiles/MNIST/metalearning_algorithms/maml_class.py", line 209, in init
self.updated_bn_model = self.assign_stats(self.X_finetune)
File "/media/nvidia/DATA1/MUHB/Few-Shot-One-Class-Classification-via-Meta-Learning/MAMLs_Reptiles/MNIST/metalearning_algorithms/maml_class.py", line 862, in assign_stats
assign_op_3 = self.layers[i].variables[-1].assign(var)
File "/home/nvidia/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/resource_variable_ops.py", line 915, in assign
self._shape.assert_is_compatible_with(value_tensor.shape)
File "/home/nvidia/anaconda3/lib/python3.7/site-packages/tensorflow/python/framework/tensor_shape.py", line 1023, in assert_is_compatible_with
raise ValueError("Shapes %s and %s are incompatible" % (self, other))
ValueError: Shapes (256,) and (512,) are incompatible

To reproduce: use the given OCMAML config file but with the dense_layers argument set to "256 128 64 64" (as suggested in MNIST/metalearning_algorithms/main.py). Any suggestions on how to fix the issue and add dense layers?

Really appreciate it!

@17011813
Copy link

17011813 commented Jan 5, 2022

Good Morning, chriskok

How did you solve this problem?

@AhmedFrikha
Copy link
Owner

Hi, sorry for the late answer. Some changes have to be made to the current code does not allow the usage of fully connected networks. I plan to add this feature soon.

@17011813
Copy link

17011813 commented Jan 28, 2022

@AhmedFrikha Hello, sir.

When are you gonna upload this feature?
I can't wait to check more operations and explanations about past issue #3

Also, How can I run your OC-MetaSGD or OC-MAML code with STS-Sawtooth dataset or CNC milling machine dataset?

Thank you again :)
Have a great day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants