1. #pip install scikit-learn
    2. import numpy as np
    3. from sklearn.metrics.pairwise import cosine_similarity
    4. weight_chip = np.fromfile('C:\\Users\\chaojunche\\Desktop\\data',dtype=np.int8)
    5. weight_chip = weight_chip.reshape(112,112,1)
    6. w = np.fromfile('C:\\Users\\chaojunche\\Desktop\\data',dtype=np.int8)
    7. w = w.reshape(112,112,1)
    8. # for i in range(32):
    9. # print(weight_chip.flatten()[i],w.flatten()[i])
    10. ret = cosine_similarity(weight_chip.reshape(1,-1), w.reshape(1,-1))
    11. print (ret)