Installation Issue #263
Answered
by
mgkwill
asudeeaydin
asked this question in
Q&A
Replies: 2 comments 1 reply
-
You can ignore the failure. This is a unit test that makes sure tutorials
don’t break during lava code development but this looks like a false
positive caused by a pickling error. It would take a long time to track
down the issue but if all other unit tests pass you should be good to go to
use lava.
…On Tue, Jul 5, 2022 at 10:50 AM Asude Aydin ***@***.***> wrote:
I'm getting the following when I follow the installation instructions in
the read me. Would someone be able to tell me what the problem is? Below is
the results after running python -m unittest.
.............................................................................s............................................................ss...................s..ss...............................................................[NbConvertApp] Converting notebook tutorial01_mnist_digit_classification.ipynb to notebook
Traceback (most recent call last):
File "/home/asude/lava/bin/jupyter-nbconvert", line 8, in <module>
sys.exit(main())
File "/home/asude/lava/lib/python3.8/site-packages/jupyter_core/application.py", line 269, in launch_instance
return super().launch_instance(argv=argv, **kwargs)
File "/home/asude/lava/lib/python3.8/site-packages/traitlets/config/application.py", line 846, in launch_instance
app.start()
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 414, in start
self.convert_notebooks()
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 588, in convert_notebooks
self.convert_single_notebook(notebook_filename)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 551, in convert_single_notebook
output, resources = self.export_single_notebook(
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/nbconvertapp.py", line 479, in export_single_notebook
output, resources = self.exporter.from_filename(
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 189, in from_filename
return self.from_file(f, resources=resources, **kw)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 206, in from_file
return self.from_notebook_node(
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/exporters/notebook.py", line 35, in from_notebook_node
nb_copy, resources = super().from_notebook_node(nb, resources, **kw)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 146, in from_notebook_node
nb_copy, resources = self._preprocess(nb_copy, resources)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/exporters/exporter.py", line 335, in _preprocess
nbc, resc = preprocessor(nbc, resc)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/preprocessors/base.py", line 47, in __call__
return self.preprocess(nb, resources)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/preprocessors/execute.py", line 89, in preprocess
self.preprocess_cell(cell, resources, index)
File "/home/asude/lava/lib/python3.8/site-packages/nbconvert/preprocessors/execute.py", line 110, in preprocess_cell
cell = self.execute_cell(cell, index, store_history=True)
File "/home/asude/lava/lib/python3.8/site-packages/nbclient/util.py", line 84, in wrapped
return just_run(coro(*args, **kwargs))
File "/home/asude/lava/lib/python3.8/site-packages/nbclient/util.py", line 62, in just_run
return loop.run_until_complete(coro)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/asude/lava/lib/python3.8/site-packages/nbclient/client.py", line 965, in async_execute_cell
await self._check_raise_for_error(cell, cell_index, exec_reply)
File "/home/asude/lava/lib/python3.8/site-packages/nbclient/client.py", line 862, in _check_raise_for_error
raise CellExecutionError.from_cell_and_msg(cell, exec_reply_content)
nbclient.exceptions.CellExecutionError: An error occurred while executing the following cell:
------------------
num_images = 25
num_steps_per_image = 128
# Create Process instances
spike_input = SpikeInput(num_images=num_images,
num_steps_per_image=num_steps_per_image,
vth=1)
mnist_clf = ImageClassifier(
trained_weights_path=os.path.join('.', 'mnist_pretrained.npy'))
output_proc = OutputProcess(num_images=num_images)
# Connect Processes
spike_input.spikes_out.connect(mnist_clf.spikes_in)
mnist_clf.spikes_out.connect(output_proc.spikes_in)
# Connect Input directly to Output for ground truth labels
spike_input.label_out.connect(output_proc.label_in)
------------------
---------------------------------------------------------------------------
UnpicklingError Traceback (most recent call last)
File ~/lava/lib/python3.8/site-packages/numpy/lib/npyio.py:438, in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
437 try:
--> 438 return pickle.load(fid, **pickle_kwargs)
439 except Exception as e:
UnpicklingError: invalid load key, 'v'.
The above exception was the direct cause of the following exception:
UnpicklingError Traceback (most recent call last)
Input In [8], in <cell line: 8>()
4 # Create Process instances
5 spike_input = SpikeInput(num_images=num_images,
6 num_steps_per_image=num_steps_per_image,
7 vth=1)
----> 8 mnist_clf = ImageClassifier(
9 trained_weights_path=os.path.join('.', 'mnist_pretrained.npy'))
10 output_proc = OutputProcess(num_images=num_images)
12 # Connect Processes
File ~/thesis/master_thesis_asude_aydin/lava/src/lava/magma/core/process/process.py:97, in ProcessPostInitCaller.__call__(cls, *args, **kwargs)
96 def __call__(cls, *args, **kwargs):
---> 97 obj = type.__call__(cls, *args, **kwargs)
98 getattr(obj, "_post_init")()
99 return obj
Input In [3], in ImageClassifier.__init__(self, **kwargs)
27 trained_weights_path = kwargs.pop('trained_weights_path', os.path
28 .join('.','mnist_pretrained.npy'))
29 real_path_trained_wgts = os.path.realpath(trained_weights_path)
---> 31 wb_list = np.load(real_path_trained_wgts, encoding='latin1', allow_pickle=True)
32 w0 = wb_list[0].transpose().astype(np.int32)
33 w1 = wb_list[2].transpose().astype(np.int32)
File ~/lava/lib/python3.8/site-packages/numpy/lib/npyio.py:440, in load(file, mmap_mode, allow_pickle, fix_imports, encoding)
438 return pickle.load(fid, **pickle_kwargs)
439 except Exception as e:
--> 440 raise pickle.UnpicklingError(
441 f"Failed to interpret file {file!r} as a pickle") from e
UnpicklingError: Failed to interpret file '/home/asude/thesis/master_thesis_asude_aydin/lava/tutorials/end_to_end/mnist_pretrained.npy' as a pickle
UnpicklingError: Failed to interpret file '/home/asude/thesis/master_thesis_asude_aydin/lava/tutorials/end_to_end/mnist_pretrained.npy' as a pickle
Fs[NbConvertApp] Converting notebook tutorial02_processes.ipynb to notebook
[NbConvertApp] Writing 22833 bytes to /tmp/tmp6csh4qnl.ipynb
.[NbConvertApp] Converting notebook tutorial03_process_models.ipynb to notebook
[NbConvertApp] Writing 25296 bytes to /tmp/tmpcubfhz7z.ipynb
.[NbConvertApp] Converting notebook tutorial04_execution.ipynb to notebook
[NbConvertApp] Writing 18083 bytes to /tmp/tmpga3vm71j.ipynb
.[NbConvertApp] Converting notebook tutorial05_connect_processes.ipynb to notebook
[NbConvertApp] Writing 16271 bytes to /tmp/tmppbx_3ya1.ipynb
.s[NbConvertApp] Converting notebook tutorial07_remote_memory_access.ipynb to notebook
[NbConvertApp] Writing 14515 bytes to /tmp/tmp6b6as0q6.ipynb
..
======================================================================
FAIL: test_end_to_end_01_mnist (tests.lava.tutorials.test_tutorials.TestTutorials)
Test tutorial end to end 01 mnist.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/asude/thesis/master_thesis_asude_aydin/lava/tests/lava/tutorials/test_tutorials.py", line 133, in test_end_to_end_01_mnist
self._run_notebook(
File "/home/asude/thesis/master_thesis_asude_aydin/lava/tests/lava/tutorials/test_tutorials.py", line 124, in _run_notebook
self.assertFalse(errors_record,
AssertionError: {'tutorial01_mnist_digit_classification.ipynb': ("Command '['jupyter', 'nbconvert', '--to', 'notebook', '--execute', '--ExecutePreprocessor.timeout=-1', '--output', '/tmp/tmpec32i2hz.ipynb', 'tutorial01_mnist_digit_classification.ipynb']' returned non-zero exit status 1.", None)} is not false : Failed to execute Jupyter Notebooks with errors:
{'tutorial01_mnist_digit_classification.ipynb': ("Command '['jupyter', 'nbconvert', '--to', 'notebook', '--execute', '--ExecutePreprocessor.timeout=-1', '--output', '/tmp/tmpec32i2hz.ipynb', 'tutorial01_mnist_digit_classification.ipynb']' returned non-zero exit status 1.", None)}
----------------------------------------------------------------------
Ran 235 tests in 53.642s
FAILED (failures=1, skipped=8)
—
Reply to this email directly, view it on GitHub
<#263>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJCHUDMP2TAGY4E76I6XTVSRYWNANCNFSM52W7WREA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
tim-shea
-
Thanks for your response @kds300, if this is due to mnist_pretrained.npy,
yes you can download directly and place in the correct folder, or use ‘git
lfs install’, ‘git lfs fetch’, ‘git lfs pull’ in the project top directory.
This is assuming that git-lfs package is installed (you can google that).
…On Tue, Jul 12, 2022 at 7:57 AM kds300 ***@***.***> wrote:
I think the error is due to how github stores the file
mnist_pretrained.npy. Instead of storing the file directly, it stores it
using git LFS (See
https://github.com/lava-nc/lava/blob/main/tutorials/end_to_end/mnist_pretrained.npy).
The file itself isn't cloned automatically so I had to manually download it
and add it to the tutorial's folder.
—
Reply to this email directly, view it on GitHub
<#263 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABJCHWVMVAQNJG4KZ6SDT3VTWBXLANCNFSM52W7WREA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm getting the following when I follow the installation instructions in the read me. Would someone be able to tell me what the problem is? Below is the results after running python -m unittest.
Beta Was this translation helpful? Give feedback.
All reactions