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

MNIST Tutorial errors out when creating object of class PyImageClassifierModel() #312

Closed
2 tasks done
JuliaA369 opened this issue Aug 19, 2022 · 2 comments
Closed
2 tasks done

Comments

@JuliaA369
Copy link

Objective of issue: Repair lava/tutorials/end_to_end/tutorial01_mnist_digit_classification.ipynb so that it runs without issues

Lava version:

  • 0.4.0 (current version)

I'm submitting a ...

  • bug report

Current behavior:

  • Errors our during run time

In the 9th cell , during execution of:

mnist_clf.run(
    condition=RunSteps(num_steps=num_steps_per_image),
    run_cfg=Loihi1SimCfg(select_sub_proc_model=True,
                         select_tag='fixed_pt'))

We get the following error

image

Expected behavior:

Steps to reproduce:

  • Run the tutorial lava/tutorials/end_to_end/tutorial01_mnist_digit_classification.ipynb

Related code:
lava/tutorials/end_to_end/tutorial01_mnist_digit_classification.ipynb

Problem can be fixed by defining the shape of the Dense() layer as follows

class PyImageClassifierModel(AbstractSubProcessModel):
    def __init__(self, proc):
        self.dense0 = Dense(weights=proc.w_dense0.init, shape=proc.w_dense0.init.shape)
        self.lif1 = LIF(shape=(64,), bias_mant=proc.b_lif1.init, vth=400,
                        dv=0, du=4095)
        self.dense1 = Dense(weights=proc.w_dense1.init, shape=proc.w_dense1.init.shape)
        self.lif2 = LIF(shape=(64,), bias_mant=proc.b_lif2.init, vth=350,
                        dv=0, du=4095)
        self.dense2 = Dense(weights=proc.w_dense2.init, shape=proc.w_dense2.init.shape)
        self.output_lif = LIF(shape=(10,), bias_mant=proc.b_output_lif.init,
                              vth=1, dv=0, du=4095)

Other information:

insert the output from lava debug here
@JuliaA369
Copy link
Author

This was a local pyenv problem. Somehow two different versions of lava were installed locally. When version 0.4.0 is properly installed and used, this problem no longer exists.

@drader
Copy link

drader commented Jan 2, 2024

I am getting the same problem;

the system is;
macOS
lava-nc v0.9.0
python 3.9.18

I've reinstalled and made pytest for lava. However, they still couldn't solve the problem. Would you happen to have any idea or solution for this issue? @JuliaA369

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

2 participants