小编mer*_*xes的帖子

使用AWS SDK for Java API时出现SSLHandshakeException

我正在使用Java API在Amazon S3中上传和下载文件.直到大约一个星期前它才完美运行,即使我没有触及代码,它也完全停止了工作.我想知道是否有解决方案.谢谢!

这里的代码运行良好:

AWSCredentials credentials = new BasicAWSCredentials(ACCESSKEYID, SECRETKEY);
AmazonS3Client s3client = new AmazonS3Client(credentials);
List<String> bucketList = new ArrayList<String>();
    for (Bucket bucket : s3client.listBuckets()) {
        System.out.println(bucket.getName());
    }
Run Code Online (Sandbox Code Playgroud)

这是错误:

Apr 11, 2015 9:44:12 PM com.amazonaws.http.AmazonHttpClient executeHelper
INFO: Unable to execute HTTP request: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1904)
at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:279)
at …
Run Code Online (Sandbox Code Playgroud)

java amazon-s3 java-api amazon-web-services aws-sdk

6
推荐指数
1
解决办法
2857
查看次数

如何在matplotlib中使节点标签更加可见

我正在使用networkxmatplotlib绘制网络图.我已经为每个节点关联了一个浮点形式的标签(最多两个小数点).我希望标签在图表中更加醒目.是否有任何类型的解决方法可以提供更好的标签可见性?

Matplotlib图

更新:我在这里找到了类似的问题,并尝试应用该解决方案.事实证明,解决方案的效果非常糟糕.

MatplotLib尝试解决方案

代码如下:

label_ratio = 1.0/8.0
    pos_labels = {} 
    #For each node in the Graph
    for node in network.graph.nodes():
        #Get the node's position from the layout
        x,y = network.position[node]
        #Get the node's neighbourhood
        N = network.graph[node]
        #Find the centroid of the neighbourhood. The centroid is the average of the Neighbourhood's node's x and y coordinates respectively.
        #Please note: This could be optimised further
        cx = sum(map(lambda x:pos[x][0], N)) / len(pos)
        cy = sum(map(lambda x:pos[x][1], …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

5
推荐指数
1
解决办法
598
查看次数

LBFGS永远收敛

我正在使用HCRF库进行序列预测任务.为了学习模型参数,我使用LBFGS,尽管有使用CG和BFGS的选项.

我注意到收敛需要很长时间.我已经将最大迭代次数(当前)设置为5000.如果我对HCRF库的解释是正确的,那么从迭代到迭代的估计值的变化会变得更小.但是,该程序似乎不会在少于5000次迭代中终止,而且它实际上只需要很长时间.

如果我将最大迭代次数设置为500,那么在第500次迭代时,结果如下所示:

Iteration 500
fx = 465.359
xnorm 38.0831, gnorm = 46.3165, step = 1line search = 1
Run Code Online (Sandbox Code Playgroud)

它以此消息终止:

L-BFGS optimization terminated with status code = -997
fx = 465.359
Run Code Online (Sandbox Code Playgroud)

这意味着已达到最大迭代次数.

这对数据意味着什么?是否可以在较早的时间(例如300次迭代)终止它?如果是这样,什么是合理的"上限"或最大迭代次数?

为了让您了解我正在训练的数据,我使用20,000 - 30,000次观察,每次观察14个特征.

谢谢,任何见解肯定会受到赞赏.

machine-learning convergence

5
推荐指数
0
解决办法
169
查看次数

Pytorch:修改 VGG16 架构

我目前正在尝试修改 VGG16 网络架构,以便它能够接受 400x400 像素的图像。

\n\n

根据我读过的文献,方法是将全连接(FC)层转换为卷积(CONV)层。这本质上“允许网络在更大的输入图像上有效地 \xe2\x80\x9cslide\xe2\x80\x9d 并对图像的不同部分进行多次评估,合并所有可用的上下文信息。” 然后,使用平均池层“将多个特征向量平均为总结输入图像的单个特征向量”。

\n\n

我已经使用此函数完成了此操作,并提出了以下网络架构:

\n\n
----------------------------------------------------------------\n        Layer (type)               Output Shape         Param #\n================================================================\n            Conv2d-1         [-1, 64, 400, 400]           1,792\n              ReLU-2         [-1, 64, 400, 400]               0\n            Conv2d-3         [-1, 64, 400, 400]          36,928\n              ReLU-4         [-1, 64, 400, 400]               0\n         MaxPool2d-5         [-1, 64, 200, 200]               0\n            Conv2d-6        [-1, 128, 200, 200]          73,856\n              ReLU-7        [-1, 128, 200, 200]               0\n            Conv2d-8        [-1, 128, 200, 200]         147,584\n              ReLU-9        [-1, 128, 200, 200]               0\n        MaxPool2d-10        [-1, 128, 100, …
Run Code Online (Sandbox Code Playgroud)

computer-vision conv-neural-network pytorch vgg-net

1
推荐指数
1
解决办法
3595
查看次数