Project structure and role __init__.py

Copyright: original works, welcome to forward! Forwarding attached link https://blog.csdn.net/qq_26369907/article/details/90300760

First, the file structure

checkpoint
data/
   __init__.py
   dataset .py
   get_data.py
models/
  __init__.py
   shuffleNetV2 .py
   ResNet .py
utils/
   __init__.py
config .py
main .py
requirement.txt
README .md

Second, the role

1. __inti__.py role

The files in each directory must exist, if the directory with the files, directories, equivalent to a bag package.
In main.py, the application dataset.py the function loader

   from data.dataset import loader

Note : If the file is added to introduce __init__.py

   from .dataset import loader

In main.py, the function of the loader dataset.py

  from data import loader

2. Directory effect

  • checkpoint directory: store the trained model
  • data directory: store data related operations, and other data preprocessing;
  • models catalog: Definition Model
  • utils directory: storage utility functions
  • config.py file: available to all static variables stored here

Guess you like

Origin blog.csdn.net/qq_26369907/article/details/90300760