Commit eb560e61 authored by Yuxin Wu's avatar Yuxin Wu

bump travis version, fix lint

parent d6c2d6b3
...@@ -20,10 +20,10 @@ matrix: ...@@ -20,10 +20,10 @@ matrix:
include: include:
- os: linux - os: linux
python: 2.7 python: 2.7
env: TF_VERSION=1.1.0 TF_TYPE=release env: TF_VERSION=1.2.0rc1 TF_TYPE=release
- os: linux - os: linux
python: 3.5 python: 3.5
env: TF_VERSION=1.1.0 TF_TYPE=release env: TF_VERSION=1.2.0rc1 TF_TYPE=release
- os: linux - os: linux
python: 2.7 python: 2.7
env: TF_VERSION=1.head TF_TYPE=nightly env: TF_VERSION=1.head TF_TYPE=nightly
......
...@@ -123,8 +123,9 @@ class Model(ModelDesc): ...@@ -123,8 +123,9 @@ class Model(ModelDesc):
[('conv0.*', 0.1), ('group[0-2].*', 0.1)])] [('conv0.*', 0.1), ('group[0-2].*', 0.1)])]
return optimizer.apply_grad_processors(opt, gradprocs) return optimizer.apply_grad_processors(opt, gradprocs)
# completely copied from imagenet-resnet.py example
def get_data(train_or_test): def get_data(train_or_test):
# completely copied from imagenet-resnet.py example
isTrain = train_or_test == 'train' isTrain = train_or_test == 'train'
datadir = args.data datadir = args.data
...@@ -224,7 +225,7 @@ def viz_cam(model_file, data_dir): ...@@ -224,7 +225,7 @@ def viz_cam(model_file, data_dir):
if wrongs[i]: if wrongs[i]:
continue continue
weight = W[:, [labels[i]]].T # 512x1 weight = W[:, [labels[i]]].T # 512x1
convmap = convmaps[i,:,:,:] # 512xhxw convmap = convmaps[i, :, :, :] # 512xhxw
mergedmap = np.matmul(weight, convmap.reshape((512, -1))).reshape(14, 14) mergedmap = np.matmul(weight, convmap.reshape((512, -1))).reshape(14, 14)
mergedmap = cv2.resize(mergedmap, (224, 224)) mergedmap = cv2.resize(mergedmap, (224, 224))
heatmap = viz.intensity_to_rgb(mergedmap, normalize=True) heatmap = viz.intensity_to_rgb(mergedmap, normalize=True)
...@@ -237,6 +238,7 @@ def viz_cam(model_file, data_dir): ...@@ -237,6 +238,7 @@ def viz_cam(model_file, data_dir):
if cnt == 500: if cnt == 500:
return return
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--gpu', help='comma separated list of GPU(s) to use.', required=True) parser.add_argument('--gpu', help='comma separated list of GPU(s) to use.', required=True)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment