Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Status Code: 502 #5

Open
claudemeisch opened this issue Sep 4, 2017 · 1 comment
Open

Request Status Code: 502 #5

claudemeisch opened this issue Sep 4, 2017 · 1 comment

Comments

@claudemeisch
Copy link

Hey,
First of all, thank you for the package.
I try to classify landmarks with the google vision API on Flickr-data. I do not want to download the data but try to classify the files by passing URLs. But I get Request Status Code: 502. Some error with a JSON content? It says no JSON content found. I cannot find any help on this? Any idea how the error is produced?

On windows x86-64, R version 3.4.1 (2017-04-21)
In Detail i do:
require(RoogleVision)
require(googleAuthR)
require(magrittr)

options("googleAuthR.client_id" = ....)
options("googleAuthR.client_secret" = ....)
options("googleAuthR.scopes.selected" = c("https://www.googleapis.com/auth/cloud-platform"))
googleAuthR::gar_auth()

Then i load a datatable with URL's of Flickr images which I want to classifiy. For this, i first read the datatable with Flickr <- data.table::fread (Flickr_data.csv) and then go

getGoogleVisionResponse(imagePath = Flickr$URL[i], feature="LANDMARK_DETECTION")

with Flickr$URL[i] being characters

Request Status Code: 502
Error : lexical error: invalid char in json text.
smallerthansign!DOCTYPE html> <html lang=engreaterthansign
(right here) ------^

Trying again: 1 of 5
Trying again: 2 of 5
Trying again: 3 of 5
Trying again: 4 of 5
Trying again: 5 of 5
Warning message:
No JSON content found in request

opened an issue here already but got referred to this site :) <- MarkEdmondson1234/googleAuthR#80 (comment)

Thank you!

@flovv
Copy link
Collaborator

flovv commented Sep 5, 2017

Hi,
it seems that your request url does not provide a path to an image.
Have you tried the call:
getGoogleVisionResponse("https://media-cdn.tripadvisor.com/media/photo-s/02/6b/c2/19/filename-48842881-jpg.jpg", feature="LANDMARK_DETECTION")

Does that one work?
Do you get a proper response by manually setting the path?
getGoogleVisionResponse(imagePath = "url.path", feature="LANDMARK_DETECTION")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants