qubvel / efficientnet

Implementation of EfficientNet model. Keras and TensorFlow Keras.
https://arxiv.org/abs/1905.11946
Apache License 2.0
2.07k stars 472 forks source link

Updates to the efficientnet conversion code. #112

Open jamlong opened 4 years ago

jamlong commented 4 years ago

Looks like tensorflow/tpu has updated since this package was last updated - the source files downloaded by the conversion script are no longer sufficient. This runs into further problems in that the new tensorflow/tpu HEAD refers to packages that aren't available in tf 1.12/1.13.

I've made the following changes to get things working:

* Updated the downloader to download src files that have been added
  since this package was last updated. Any thoughts on using a 
  git submodule in lieu of manually downloading files here? 
* The new tensorflow/tpu changes appear to require tensorflow 1.14+/2.x
  as they refer to modules that don't appear to exist in tf 1.12/1.13
* Checkpoint paths changed, as well (now in a /ckpts/ subdirectory)
* Updated load_efficientnet.py to be tensorflow 1.x/2.x compatible.
* Added a --noweights_only option to the conversion script, which
  passes through to load_efficientnet to produce .h5 files with both
  configs and weights.
* Added a --parallel_conversion option to the conversion script,
  which runs the conversion jobs as background processes, and then
  sequentially waits on them. The conversion job is largely CPU
  bound, and runs on a single CPU.
* Updated requirements.txt to include keras and tensorflow, as they appear
  to both be necessary (e.g. I'm not using the "keras" version of keras, but it
  fails if it's not present)
* Updated README.md
   * Instructions for installing aria2
   * Updated instructions for running the conversion script.