Skip to content

Cannot replicate extraction to MLCert #8

@wenkokke

Description

@wenkokke

I'm currently trying to replicate the extraction from an EMNIST network to MLCert. This is as far as I've gotten trying to get the code in NNCert to work, patching things up as I go:

  1. Install Miniconda

  2. conda create --name NNCert python=3.5

  3. conda activate NNCert

  4. pip install tensorflow==1.6.1

  5. Download EMNIST

  6. Patch MLCert/NNCert/tf/extract_emnist.py:

    • Line 6: Change emnist_load_data() to emnist_load_data(<path/to/emnist>)
    • Note: The script will try to load from <path/to/emnist>/emnist
  7. python extract_emnist.py (from MLCert/NNCert/tf)

  8. Patch MLCert/NNCert/tf/dataset_params.py:

    • Restore definition make_dataset:
      def make_dataset(images, labels):
        return DataSet(images, labels, reshape=False, dtype=tf.uint8)
      
  9. Patch MLCert/NNCert/tf/pca.py:

    • Line 9: Change _, _, _, _, _, load_data = .. to _, load_data = ..
  10. python pca.py (from MLCert/NNCert/tf)

  11. Rename generated files <path/to/emnist>/emnist/{train,test,validation}_reduced.pkl to <path/to/emnist>/emnist/{train,test,validation}_pca.pkl

  12. Patch MLCert/NNCert/tf/Makefile:

    • Line 7: Change train.py to main.py
    • Line 10: Change eval.py to main.py
  13. Patch MLCert/NNCert/tf/main.py:

    • Line 41: Change hidden_sizes = map(..) to hidden_sizes = list(map(..))
  14. make (from MLCert/NNCert/tf)

  15. 😭😭😭

    FileNotFoundError: [Errno 2] No such file or directory: 'models/default/params.pkl.gz'
    make: *** [train] Error 1
    

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions