所有放置在 try:
with h5py.File(self.datapath, 'w') as hf:
hf.create_dataset('saliencys', data=sal_maps)
hf.create_dataset('probs', data=probs)
hf.create_dataset('preds', data=preds)
hf.close()
del sal_maps,probs,preds
sal_maps = np.array([], dtype=np.float32).reshape((0,) + img_size)
probs = np.array([], dtype=np.float32)
preds = np.array([], dtype=np.uint8)
gc.collect()
except:
print('except->{}'.format(sal_maps.shape[0]))
with h5py.File(self.datapath, 'a') as hf:
hf["saliencys"].resize((hf["saliencys"].shape[0] + sal_maps.shape[0]))
hf['saliencys'][-sal_maps.shape[0]:] = sal_maps
hf['probs'].resize(hf['probs'].shape[0] + sal_maps.shape[0])
hf['probs'][-probs.shape[0]:] = probs
hf['preds'].resize(hf['preds'].shape[0] + preds.shape[0])
hf['preds'][-preds.shape[0]:] = preds
del sal_maps,probs,preds
hf.close()
sal_maps = np.array([], dtype=np.float32).reshape((0,) + img_size)
probs = np.array([], dtype=np.float32)
preds = np.array([], dtype=np.uint8)
gc.collect()
print("done appending....")
sal_maps = np.array([], dtype=np.float32).reshape((0,) + img_size)
probs = np.array([], dtype=np.float32)
preds = np.array([], dtype=np.uint8)
print('Save_saliency_maps::',idx)
中的ClientID,ClientSecret和RedirectURI。
web.config
现在从这里我得到了验证码。
<appSettings>
<add key="redirectURI" value="http://localhost:55593/oauthplayground" />
<add key="clientId" value="uX4YpHHNm****ltekoG" />
<add key="clientSecret" value="K5cSv3izT1GZ9PXnaWWfRWbTv10*****O3JkYFMlWMF3FhBtjyk0FqJduGJZSAL7B1DngJyxgX3KKNSD0Bqdv" />
</appSettings>
然后我得到了我的授权码:
static string redirectURI = ConfigurationManager.AppSettings["redirectURI"];
static string clientID = ConfigurationManager.AppSettings["clientID"];
static string clientSecret = ConfigurationManager.AppSettings["clientSecret"];
protected void btnclick_Click(object sender, EventArgs e)
{
Response.Redirect(String.Format("https://d****o.com/o/authorize/?response_type=code&client_id={0}&redirect_uri={1}", clientID, redirectURI));
}
(我将此代码存储在标签中,即3Q8tvb9d0fj232NZZIAIaItUIqtAd7
)
然后使用Access_token和Refresh令牌,我使用以下代码:
lblcode.Text
但是我遇到一个错误:
请求已中止:无法创建SSL / TLS安全通道。
注意:
答案 0 :(得分:1)
将此代码放在
上方ServicePointManager.Expect100Continue = true;
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;
以下代码。
var request = WebRequest.Create("https://drchrono.com/o/token/");'