(network, path='models')
| 38 | |
| 39 | |
| 40 | def restore_params(network, path='models'): |
| 41 | logging.info("Restore pre-trained parameters") |
| 42 | maybe_download_and_extract( |
| 43 | 'mobilenet.npz', path, 'https://github.com/tensorlayer/pretrained-models/raw/master/models/', |
| 44 | expected_bytes=25600116 |
| 45 | ) # ls -al |
| 46 | params = load_npz(name=os.path.join(path, 'mobilenet.npz')) |
| 47 | # for idx, net_weight in enumerate(network.all_weights): |
| 48 | # if 'batchnorm' in net_weight.name: |
| 49 | # params[idx] = params[idx].reshape(1, 1, 1, -1) |
| 50 | assign_weights(params[:len(network.all_weights)], network) |
| 51 | del params |
| 52 | |
| 53 | |
| 54 | def MobileNetV1(pretrained=False, end_with='out', name=None): |
no test coverage detected
searching dependent graphs…