Git Product home page Git Product logo

Comments (4)

busunkim96 avatar busunkim96 commented on June 16, 2024

Hi,

The 503s are most likely connectivity issues specific to that environment, especially if you can get the script to run in other machines.

As for the last error, I'm not quite sure what could be causing it. That requests transport has been there for a long time so any recent version of google-auth should be sufficient.

Can you please share:

(1) The Python version you are using.
(2) A code snippet.
(3) The versions of the libraries you have installed.pip freeze

(Tentatively moving to aiplatform, but may end up coming back to api-core.)

from python-aiplatform.

Winthan avatar Winthan commented on June 16, 2024

@busunkim96 I am using

  1. Python 3.8.3 (default, Jul 2 2020, 17:30:36) [MSC v.1916 64 bit (AMD64)]
    IPython 7.16.1 -- An enhanced Interactive Python.

  2.              import os
                 os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "C:\\cloud\\api.json"
                 from typing import Dict
    
                 from google.cloud import aiplatform
                 from google . protobuf  import  json_format
                 from google.protobuf.struct_pb2 import Value
                 
                 payload = { 
                     "volume":  '1000'
                     }
                 
    
                 def predict_tabular_regression_sample(
                     project: str,
                     endpoint_id: str,
                     instance_dict: Dict,
                     location: str = "us-central1",
                     api_endpoint: str = "us-central1-prediction-aiplatform.googleapis.com",
                 ):
                     client_options = {"api_endpoint": api_endpoint}
                     # Initialize client that will be used to create and send requests.
                     # This client only needs to be created once, and can be reused for multiple requests.
                     client = aiplatform.gapic.PredictionServiceClient(client_options=client_options)
                     # for more info on the instance schema, please use get_model_sample.py
                     # and look at the yaml found in instance_schema_uri
                     instance = json_format.ParseDict(instance_dict, Value())
                     instances = [instance]
                     parameters_dict = {}
                     parameters = json_format.ParseDict(parameters_dict, Value())
                     endpoint = client.endpoint_path(
                         project=project, location=location, endpoint=endpoint_id
                     )
                     response = client.predict(
                         endpoint=endpoint, instances=instances, parameters=parameters
                     )
                     #("response")
                    #print(" deployed_model_id:", response.deployed_model_id)
                     # See gs://google-cloud-aiplatform/schema/predict/prediction/tables_regression.yaml for the format of the predictions.
                     predictions = response.predictions
                     for  prediction  in  predictions :
                         print("prediction:", dict(prediction))
                         print("this is the prediction", prediction["value"])
                         
                 
                 ENDPOINT_ID="3406442547744"
                 PROJECT_ID = "screener"
                 
                 INSTANCE = payload
                 
                 predict_tabular_regression_sample(
                         instance_dict=INSTANCE, project=PROJECT_ID, endpoint_id=ENDPOINT_ID
                     )
    

I have following  

['-illow==7.2.0', 'alabaster==0.7.12', 'anaconda-client==1.7.2', 'anaconda-navigator==1.9.12', 'anaconda-project==0.8.3', 'aniso8601==8.0.0', 'argh==0.26.2', 'asn1crypto==1.3.0', 'astroid==2.4.2', 'astropy==4.0.1.post1', 'atomicwrites==1.4.0', 'attrs==19.3.0', 'autopep8==1.5.3', 'babel==2.8.0', 'backcall==0.2.0', 'backports.functools-lru-cache==1.6.1', 'backports.shutil-get-terminal-size==1.0.0', 'backports.tempfile==1.0', 'backports.weakref==1.0.post1', 'bcrypt==3.1.7', 'beautifulsoup4==4.9.1', 'bitarray==1.4.0', 'bkcharts==0.2', 'bleach==3.1.5', 'bokeh==2.1.1', 'boto==2.49.0', 'bottleneck==1.3.2', 'bpemb==0.3.2', 'brotlipy==0.7.0', 'cachetools==4.1.1', 'certifi==2020.6.20', 'cffi==1.14.4', 'chardet==3.0.4', 'click==7.1.2', 'cloudpickle==1.6.0', 'clyent==1.2.2', 'colorama==0.4.4', 'colorlog==4.6.2', 'comtypes==1.1.7', 'conda-build==3.18.11', 'conda-package-handling==1.7.0', 'conda-verify==3.4.2', 'conda==4.8.3', 'contextlib2==0.6.0.post1', 'cryptography==3.2.1', 'cycler==0.10.0', 'cython==0.29.21', 'cytoolz==0.10.1', 'dask==2.20.0', 'decorator==4.4.2', 'defusedxml==0.6.0', 'deprecated==1.2.10', 'diff-match-patch==20200713', 'dill==0.3.3', 'distributed==2.20.0', 'docutils==0.16', 'entrypoints==0.3', 'et-xmlfile==1.0.1', 'fastcache==1.1.0', 'filelock==3.0.12', 'flair==0.6.1', 'flake8==3.8.3', 'flask-cors==3.0.9', 'flask-restx==0.2.0', 'flask==1.1.2', 'fsspec==0.7.4', 'ftfy==5.8', 'future==0.18.2', 'gdown==3.12.2', 'gensim==3.8.3', 'gevent==20.6.2', 'glob2==0.7', 'gmpy2==2.0.8', 'google-api-core==1.23.0', 'google-api-python-client==1.12.8', 'google-auth-httplib2==0.0.4', 'google-auth==1.23.0', 'google-cloud-aiplatform==0.3.1', 'google-cloud-automl==2.1.0', 'google-cloud-bigquery==2.5.0', 'google-cloud-core==1.4.4', 'google-cloud-storage==1.33.0', 'google-cloud==0.34.0', 'google-crc32c==1.0.0', 'google-resumable-media==1.1.0', 'google==3.0.0', 'googleapis-common-protos==1.52.0', 'goto-statement==1.2', 'greenlet==0.4.16', 'grpcio==1.33.2', 'h5py==2.10.0', 'heapdict==1.0.1', 'html5lib==1.1', 'httplib2==0.18.1', 'hyperopt==0.2.5', 'idna==2.10', 'imagehash==4.0', 'imageio==2.5.0', 'imagesize==1.2.0', 'importlib-metadata==1.7.0', 'iniconfig==1.1.1', 'intervaltree==3.0.2', 'ipykernel==5.3.2', 'ipython-genutils==0.2.0', 'ipython==7.16.1', 'ipywidgets==7.5.1', 'isort==4.3.21', 'itsdangerous==1.1.0', 'janome==0.4.1', 'jdcal==1.4.1', 'jedi==0.17.1', 'jinja2==2.11.2', 'joblib==0.17.0', 'json5==0.9.5', 'jsonschema==3.2.0', 'jupyter-client==6.1.6', 'jupyter-console==6.1.0', 'jupyter-core==4.6.3', 'jupyter==1.0.0', 'jupyterlab-server==1.2.0', 'jupyterlab==2.1.5', 'keyring==21.2.1', 'kiwisolver==1.2.0', 'konoha==4.6.2', 'langdetect==1.0.8', 'lazy-object-proxy==1.4.3', 'libarchive-c==2.9', 'libcst==0.3.14', 'lightwood==0.48.0', 'llvmlite==0.33.0+1.g022ab0f', 'locket==0.2.0', 'lxml==4.6.2', 'markupsafe==1.1.1', 'matplotlib==3.2.2', 'mccabe==0.6.1', 'menuinst==1.4.16', 'mindsdb-native==2.22.0', 'mindsdb==2.13.8', 'mistune==0.8.4', 'mkl-fft==1.1.0', 'mkl-random==1.1.1', 'mkl-service==2.3.0', 'mo-future==3.147.20327', 'mock==4.0.2', 'more-itertools==8.4.0', 'moz-sql-parser==3.32.20026', 'mpld3==0.3', 'mplfinance==0.12.7a0', 'mpmath==1.1.0', 'msgpack==1.0.0', 'multipledispatch==0.6.0', 'mypy-extensions==0.4.3', 'mysql-connector-python==8.0.22', 'navigator-updater==0.2.1', 'nbconvert==5.6.1', 'nbformat==5.0.7', 'nest-asyncio==1.4.0', 'networkx==2.5', 'nltk==3.5', 'nonconformist==2.1.0', 'nose==1.3.7', 'notebook==6.0.3', 'numba==0.50.1', 'numexpr==2.7.1', 'numpy==1.18.5', 'numpydoc==1.1.0', 'oauth2client==4.1.3', 'olefile==0.46', 'openpyxl==3.0.4', 'overrides==3.0.0', 'packaging==20.4', 'pandas-ta==0.1.97b0', 'pandas==1.0.5', 'pandocfilters==1.4.2', 'paramiko==2.7.1', 'parso==0.7.0', 'partd==1.1.0', 'path==13.1.0', 'pathlib2==2.3.5', 'pathtools==0.1.2', 'patsy==0.5.1', 'pep8==1.7.1', 'pexpect==4.8.0', 'pg8000==1.16.6', 'pickleshare==0.7.5', 'pillow==6.2.2', 'pip==20.1.1', 'pkginfo==1.5.0.1', 'pluggy==0.13.1', 'ply==3.11', 'portalocker==2.0.0', 'prometheus-client==0.8.0', 'prompt-toolkit==3.0.5', 'proto-plus==1.11.0', 'protobuf==3.14.0', 'psutil==5.7.0', 'py==1.9.0', 'pyasn1-modules==0.2.8', 'pyasn1==0.4.8', 'pycodestyle==2.6.0', 'pycosat==0.6.3', 'pycparser==2.20', 'pycurl==7.43.0.5', 'pydocstyle==5.0.2', 'pyflakes==2.2.0', 'pygments==2.6.1', 'pylint==2.5.3', 'pymongo==3.11.1', 'pynacl==1.4.0', 'pyodbc==4.0.0-unsupported', 'pyopenssl==19.1.0', 'pyparsing==2.3.1', 'pyreadline==2.1', 'pyrsistent==0.17.3', 'pysocks==1.7.1', 'pytest==6.1.2', 'python-dateutil==2.8.0', 'python-jsonrpc-server==0.3.4', 'python-language-server==0.34.1', 'python-multipart==0.0.5', 'python-tds==1.10.0', 'pythonnet==2.5.1', 'pytz==2020.1', 'pywavelets==1.1.1', 'pywin32-ctypes==0.2.0', 'pywin32==300', 'pywinpty==0.5.7', 'pyyaml==5.3.1', 'pyzmq==19.0.1', 'qdarkstyle==2.8.1', 'qtawesome==0.7.2', 'qtconsole==4.7.5', 'qtpy==1.9.0', 'regex==2020.6.8', 'requests==2.24.0', 'rope==0.17.0', 'rsa==4.6', 'rtree==0.9.4', 'ruamel-yaml==0.15.87', 'sacremoses==0.0.43', 'schema==0.7.2', 'scikit-image==0.16.2', 'scikit-learn==0.23.2', 'scipy==1.4.1', 'scramp==1.2.0', 'seaborn==0.10.1', 'segtok==1.5.10', 'send2trash==1.5.0', 'sentencepiece==0.1.94', 'setuptools==49.2.0.post20200714', 'simplegeneric==0.8.1', 'singledispatch==3.4.0.3', 'sip==4.19.13', 'six==1.15.0', 'sklearn==0.0', 'smart-open==4.0.1', 'snowballstemmer==2.0.0', 'sortedcollections==1.2.1', 'sortedcontainers==2.2.2', 'soupsieve==2.0.1', 'sphinx==3.1.2', 'sphinxcontrib-applehelp==1.0.2', 'sphinxcontrib-devhelp==1.0.2', 'sphinxcontrib-htmlhelp==1.0.3', 'sphinxcontrib-jsmath==1.0.1', 'sphinxcontrib-qthelp==1.0.3', 'sphinxcontrib-serializinghtml==1.1.4', 'sphinxcontrib-websupport==1.2.3', 'spyder-kernels==1.9.2', 'spyder==4.1.4', 'sqlalchemy==1.3.18', 'sqlitedict==1.7.0', 'statsmodels==0.11.1', 'sympy==1.6.1', 'tables==3.6.1', 'tabulate==0.8.7', 'tblib==1.6.0', 'terminado==0.8.3', 'testpath==0.4.4', 'threadpoolctl==2.1.0', 'tokenizers==0.9.2', 'toml==0.10.2', 'toolz==0.10.0', 'torch==1.4.0+cpu', 'torchvision==0.5.0+cpu', 'tornado==6.0.4', 'tqdm==4.47.0', 'traitlets==4.3.3', 'transformers==3.4.0', 'typing-extensions==3.7.4.2', 'typing-inspect==0.6.0', 'ujson==1.35', 'unicodecsv==0.14.1', 'uritemplate==3.0.1', 'urllib3==1.25.9', 'waitress==1.4.4', 'watchdog==0.10.3', 'wcwidth==0.2.5', 'webencodings==0.5.1', 'websocket-client==0.57.0', 'websockets==8.1', 'werkzeug==1.0.1', 'wheel==0.34.2', 'widgetsnbextension==3.5.1', 'win-inet-pton==1.1.0', 'win-unicode-console==0.5', 'wincertstore==0.2', 'wrapt==1.12.1', 'xlrd==1.2.0', 'xlsxwriter==1.2.9', 'xlwings==0.19.5', 'xlwt==1.3.0', 'xmltodict==0.12.0', 'yapf==0.30.0', 'zict==2.0.0', 'zipp==3.1.0', 'zope.event==4.4', 'zope.interface==4.7.1']

from python-aiplatform.

dizcology avatar dizcology commented on June 16, 2024

@Winthan To make sure this is not caused by some hidden dependency issues, could you try a clean installation of the library in a virtual environment and try again?

from python-aiplatform.

sgreenberg avatar sgreenberg commented on June 16, 2024

Thank you for filing this issue. We asked some clarifying questions a week or more ago and never heard back from you. We are unable to proceed with this issue until then, so we are closing it. Please feel free to re-open this issue with more information.

from python-aiplatform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.