It is weird to see this as the result, please tell me what should I do now.
I cannot find anything helpful through Google, please help me, thanks
When I execute the command:
gcloud ml speech recognize 'gs://cloud-smaples-test-01/speech/test.wav' --language-code='en-US'
on my computer, the only response that I can see is this:
ERROR: (gcloud.ml.speech.recognize) Invalid audio source ['gs://cloud-smaples-test-01/speech/test.wav']. The source must either be a local path or a Google Cloud Storage URL (such as gs://bucket/object).
smaples is correct, I do change the order to avoid the same name.
However, when I execute the same command on Google Cloud Shell, I can see the result of speech to text. I do not know what happened exactly.
I use the same Google account to execute command whatever on my computer or Google Cloud Shell. I also set the file even the whole storage can be read by anyone.
What could cause this problem?
result on my computer
result on google cloud shell
You seem to be running Windows in your computer. The problem is that Windows interprets quotation marks as part of the string.
Removing the quotes in both your bucket path and the language code tag will resolve the issue.
Example:
gcloud ml speech recognize gs://cloud-smaples-test-01/speech/test.wav --language-code=en-US
Related
I am making a text detection application, using google vision api.
I want to figure out the way for a OCR detection function be able to load the jpg file.
This is a code referance I get from google codelab, but when try to open the url= gs:// like the diagram demonstartes, the error message saying invalid arguments. I wonder if I have missed anything??
Then, i found out that, when it is deployed on cloud functions, google vision will load image from storage. but HOW? I can not find any relenvant documents giving a detailed process about this. I am new to the code and bad at finding these instructions. Does anyone knows how can I successfuly reads/connect to the jpg file? or maybe provide a reference link regarding this? Thank you!
The code on my end is running fine and appears to be correct, I just copied the code and run it through Google Cloud Shell, Be sure to install the Vision API python client library in your cloud shell: pip install --upgrade google-cloud-vision If your intention is to open the the image you can access the image sample provided in the reference you mentioned here: https://storage.cloud.google.com/cloud-samples-data/vision/text/screen.jpg the uri provided in the code is the resource location of the image that is stored in Google Cloud Storage, the link above is the url equivalent of it .
Output:
I would suggest reading through official documents for more information about the API using client libraries here and although different implementation you can view this OCR usage here.
I am trying to pull data from the google playstore console through the cli.
The documentation that I am using as a reference is this.
I have retrieved my cloud storage URI from the playstore console and used the command:
gsutil cp -r gs://pubsite_prod_xxxxxx/stats/installs/installs_com.my.package_2021* .
I get an error message like this:
zsh: no matches found: gs://pubsite_prod_xxxxx/stats/installs/installs_com.my.package_2021*
I am trying to understand what the issue could be. Any pointers would be of great help.
Other details:
Though my playstore account is two or three years old, I just created my google cloud platform account. (So, could the issue be that there are no reports written onto my bucket, though there is a URI mentioned on the play console?)
I am unable to see this bucket through the google cloud platform console. The list of buckets are empty. (I am however not sure whether I am looking at the right place). Attaching a screenshot of the project on the console that I am looking into.
screenshot - empty list of buckets
This is an issue related to ZSH You may could change your shell, via sudo chsh --shell=/bin/bash $USER will change the shell field in /etc/passwd
Or you may use ' around a special character to escape the special character in order to let the shell recognize it. like:
gsutil cp -r 'gs://pubsite_prod_xxxxxx/stats/installs/installs_com.my.package_2021*' .
Trying to create a VM instance in Google Cloud Platform. Getting error in the mentioned process. Trying to resolve it.
Error: **Could not fetch a resource:
Invalid value for field 'resource.networkInterfaces[0].subnetwork': 'https://compute.googleapis.com/compute/v1/projects/xxx/regions/us/subnetworks/10.128.0.0/20'. The URL is malformed.**
Anyone, please guide me. My intention to make VM creation automated and make it simple by putting it all together in an automated Bash Script.
The error indicates that the URL is malformed. It probably because that "subnetwork" does not exist as you write it.
One way to fix it is to have a look in the documentation to know the right way to write the command. Also be sure that that subnet exist in your GCP project.
https://cloud.google.com/vpc/docs/create-use-multiple-interfaces
The easy way to avoid typos is to create the VM in the console the first time (you don't really have to create it, just start the form), at the bottom of the page you will see a line that says "Equivalent REST or command line", click in "command line" to see exactly the CLI command equivalent to the VM you are configuring. Use this command line in your CLI console or script.
Clicking in the "command line" will return something like:
gcloud compute instances create VM_NAME \
--network=NETWORK_NAME \
--subnet=SUBNET_NAME \
--zone=ZONE
with all the parameters already filled in for you.
I am new to Google Cloud Platform (GCP) and wanted to find out how to call my script from a request on my app I am building.
I want to be able to parse a variable into my python script running on my VM, and then return the result.
Or even call a function in one of my python files, and return the result.
If someone could give an example of a basic request parsing in a function and capturing the output, or link me to an example, that would be much appreciated.
Thanks
Linux n00b here having trouble pulling a file from the server to my local Windows 7 professional 64 bit machine. I am using Wowza to stream live video and I am recording these live videos to my Google Cloud instance located here:
/usr/local/WowzaStreamingEngine/content/myStream.mp4
When I ssh:
gcutil --project=”myprojectname” pull “my instance”
“/usr/local/WowzaStreamingEngine/content/myStream.mp4” “/folder1”
I receive a permission denied error. When I try saving another folder deep on my local machine i.e "/folder1/folder2" the error returned is file or directory not found. I've checked that I have write permisions set on my local Windows 7 machine so I do not think it is a permissions error. Again, apologize for the n00b question, I'm just been stuck here for hours.
Thx,
~Greg
Comment added 7/18:
I enter the following through ssh:
gcutil --project=”Myproject” pull “instance-1” "/usr/local/WowzaStreamingEngine/content/myStream.mp4” “/content"
By entering this I'm expecting the file mystream.mp4 to be copied to my C:/content folder. The following is returned: Warning: Permanently added '107.178.218.8' (ECDSA) to the list of known hosts. Enter passphrase for key '/home/Greg/.ssh/google_compute_engine':
Here I enter the passphrase and the following error is returned: /content: Permission denied Have write set up on this folder. Thanks! – Greg
-=-=-==->
To answer the question about using Cygwin, I'm not familiar with Cygwin and I do not believe it was used in this instance. I ran these commands through the Google Cloud SDK shell which I installed per the directions found here: https://developers.google.com/compute/docs/gcutil/.
What I am doing:
After setting up my google cloud instance I open Google CLoud SDK and enter the following:
gcutil --service_version="v1" --project="myproject" ssh --zone="us-central1-a" "instance-1"
I then am prompted for a passphrase which I create and then run the following:
curl http://metadata/computeMetadata/v1/instance/id -H "X-Google-Metadata-Request:True"
This provides the password I use to login to the Wowza live video streaming engine. All of this works beautifully, I can stream video and record the video to the following location: /usr/local/WowzaStreamingEngine/content/myStream.mp4
Next I attempt to save the .mp4 file to my local drive and that is where I'm having issues. I attempt to run:
gcutil --project=”myproject” pull “instance-1” “/usr/local/WowzaStreamingEngine/content/myStream.mp4” “C:/content”
also tried, C:/content C:\content and C:\content
These attempts threw the following error:
Could not resolve hostname C: Name or service not known
Thanks again for your time, I know it is valuable, I really appreciate you helping out a novice.
Update I believe I am close thanks to your help. Switched to local C drive, entered the command as you displayed in your Answer update. Now returning a new, not before seen error:
Error: API rate limit exceeded
I did some research on S.O. and some suggestions made were that billing is not enabled or the relevant API is not enabled and I could solve by turning on Google Compute Engine. Billing has been enabled for a few weeks now on my project. In terms of Google Compute Engine, below are what I believe to be the relevant items turned on:
User Info: Enabled
Compute: Read Write
Storage: Full
Task Queue: Enabled
BigQuery: Enabled
Cloud SQL: Enabled
Cloud Database: Enabled
The test video I recorded was short and small in size. I also have not done anything else with this instance so at a loss as to why I am getting the API rate exceeded error.
I also went to the Google APIs console. I see very limited usage reported so, again, not sure why I am exceeding the API limit. Perhaps I do not have something set appropriately in the APIs console?
I'm guessing you're using Cygwin here (please correct me if I'm wrong).
The root directory for your Cygwin installation is most likely C:\cygwin (see FAQ) and not C: so when you say /content on the command line, you're referring to C:\cygwin\content and not C:\content.
Secondly, since you're likely running as a regular user (and not root) you cannot write to /content so that's why you're getting the permission denied error.
Solution: specify the target directory as C:/content (or C:\\content) rather than /content.
Update: from the update to the question, you're using the Google Cloud SDK shell, not Cygwin, so the above answer does not apply. The reason you're seeing the error:
Could not resolve hostname C: Name or service not known
is because gcutil (like ssh) parses destinations which include : as having the pattern [hostname]:[path]. Thus, you should avoid : in the destination, which means we need to drop the drive spec.
In this case, the following should suffice, assuming that you're currently at a prompt that looks like C:\...>:
gcutil --project=myproject pull instance-1 /usr/local/WowzaStreamingEngine/content/myStream.mp4 \content
If not, first switch to the C: drive by issuing the command:
C:
and then run the above command.
Note: I removed the quotes from the command line because you don't need it in the case where parameters don't have spaces in them.