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

Error when running csnn_pc_mnist.py #13

Open
pedrombmachado opened this issue Dec 1, 2017 · 4 comments
Open

Error when running csnn_pc_mnist.py #13

pedrombmachado opened this issue Dec 1, 2017 · 4 comments

Comments

@pedrombmachado
Copy link

Dear Peter and dear Matthew,
I would like to congratulate you both for the high-quality paper that you have published. I am trying to run your code and I am getting the following error:
$python csnn_pc_mnist.py

Optional argument values:

  • post_pre : postpre
  • conv_features : 50
  • random_seed : 42
  • conv_size : 16
  • weight_dependence : no_weight_dependence
  • weight_sharing : no_weight_sharing
  • reduced_dataset : False
  • conv_stride : 4
  • sort_euclidean : False
  • do_plot : False
  • connectivity : none
  • mode : train
  • num_examples : 10000
  • random_lattice_prob : 0.0
  • examples_per_class : 100
  • random_inhibition_prob : 0.0
  • top_percent : 10
  • num_classes : 10
  • lattice_structure : 4

Traceback (most recent call last):
File "csnn_pc_mnist.py", line 970, in
elif test_mode:
NameError: name 'test_mode' is not defined

Can you please advise on how to solve it?
BW
Pedro

@pedrombmachado
Copy link
Author

I was able to pass the error by defining the test_mode=True after the import statements.

@djsaunde
Copy link
Owner

djsaunde commented Dec 1, 2017

Hi Pedro,

This repo contains code extended from that of the paper by Peter Diehl and Matthew Cook. To see the original code, check out this repo.

@pedrombmachado
Copy link
Author

Hi @djsaunde ,
Many thanks for the update. BTW there is another bug here:
Classification performance (all) [ 13. 59. 70. 77. 73. 71. 72. 82. 82. 73. 67. 78. 74. 80. 79. 77. 84. 83. 84. 84. 82. 83. 82. 82. 82. 81. 80. 81. 83. 72. 76. 82. 85. 73. 85. 76. 81. 83. 78. 81.
82. 82. 80. 81. 82. 80. 79. 77. 78. 79. 85. 79. 80. 77. 85. 82. 80. 71. 72. 83. 89. 89. 78. 90. 74. 87. 85. 83. 78. 77. 72. 76. 74. 81. 83. 78. 69. 74. 75. 75.
86. 74. 69. 83. 70. 86. 77. 73. 78. 77. 82. 83. 87. 71. 81. 78. 87. 75. 86.]
Average performance: 78.3232323232

Classification performance (top_percent) [ 13. 65. 65. 76. 67. 71. 75. 78. 73. 77. 66. 77. 71. 78. 76. 77. 78. 84. 80. 75. 80. 80. 83. 77. 80. 80. 77. 79. 78. 69. 74. 79. 78. 71. 86. 77. 82. 80. 77. 84.
81. 83. 81. 80. 85. 82. 76. 79. 82. 81. 75. 79. 77. 77. 85. 80. 80. 72. 81. 82. 86. 88. 78. 88. 74. 84. 85. 78. 76. 73. 73. 70. 72. 77. 86. 77. 64. 67. 73. 75.
88. 70. 60. 81. 69. 81. 71. 73. 79. 75. 77. 83. 86. 66. 79. 63. 84. 70. 85.]
Average performance: 76.5151515152

runs done: 9910 of 10000 (time taken for past 10 runs: 7.21255397797)
runs done: 9920 of 10000 (time taken for past 10 runs: 6.59374213219)
runs done: 9930 of 10000 (time taken for past 10 runs: 6.44509911537)
runs done: 9940 of 10000 (time taken for past 10 runs: 5.79141306877)
runs done: 9950 of 10000 (time taken for past 10 runs: 6.67625212669)
runs done: 9960 of 10000 (time taken for past 10 runs: 6.6978521347)
runs done: 9970 of 10000 (time taken for past 10 runs: 5.98725914955)
runs done: 9980 of 10000 (time taken for past 10 runs: 6.86167407036)
runs done: 9990 of 10000 (time taken for past 10 runs: 6.04048490524)

...Saving results
Traceback (most recent call last):
File "csnn_pc_mnist.py", line 1176, in
save_results()
File "csnn_pc_mnist.py", line 849, in save_results
save_connections(weights_dir, connections, input_connections, ending)
TypeError: save_connections() takes exactly 5 arguments (4 given)

I hope it helps!
BW
Pedro

@pedrombmachado
Copy link
Author

Hi @djsaunde ,
I created a pull request for correcting the bug.
BW
Pedro

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