Closed DaweiXi360 closed 3 years ago
m = np.array([[0. ,1. ,0. ,1. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,1. ,1. ,1.], [0. ,0. ,0. ,1. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,0. ,0. ,0.], [0. ,0. ,0. ,0. ,0. ,0. ,1.], [0. ,0. ,0. ,0. ,0. ,0. ,0.]]) ops=['input', 'maxpool3x3', 'conv1x1-bn-relu' , 'conv3x3-bn-relu', 'conv3x3-bn-relu', 'conv3x3-bn-relu','output'] cell = api.ModelSpec(matrix=m, ops=ops) print(nasbench.is_valid(cell))
m is a matrix I searched by autoshrink, is_valid is true
And then, data = nasbench.query(cell) for k, v in data.items(): print('%s: %s' % (k, str(v)))
It will report
KeyError Traceback (most recent call last)
the type should be int
m = np.array([[0. ,1. ,0. ,1. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,1. ,1. ,1.], [0. ,0. ,0. ,1. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,0. ,1. ,1.], [0. ,0. ,0. ,0. ,0. ,0. ,0.], [0. ,0. ,0. ,0. ,0. ,0. ,1.], [0. ,0. ,0. ,0. ,0. ,0. ,0.]]) ops=['input', 'maxpool3x3', 'conv1x1-bn-relu' , 'conv3x3-bn-relu', 'conv3x3-bn-relu', 'conv3x3-bn-relu','output'] cell = api.ModelSpec(matrix=m, ops=ops) print(nasbench.is_valid(cell))
m is a matrix I searched by autoshrink, is_valid is true
And then, data = nasbench.query(cell) for k, v in data.items(): print('%s: %s' % (k, str(v)))
It will report
KeyError Traceback (most recent call last)