jina-ai/jina

TransformerTorchEncoder Install Cannot Find torch Version

dkintgen opened this issue · 6 comments

Describe the bug
I am attempting to leverage a TransformerTorchEncoder in my flow to index documents. When I run flow.index(docs, show_progress=True) with this encoder, it fails when attempting to install with the message:

CalledProcessError: Command '['/home/ec2-user/anaconda3/envs/python3/bin/python', '-m', 'pip', 'install', '--compile', '--default-timeout=1000', 'torch==1.9.0+cpu', 'transformers>=4.12.0', '-f', 'https://download.pytorch.org/whl/torch_stable.html']' returned non-zero exit status 1.

This is the detailed info I can find in the error:

Looking in links: https://download.pytorch.org/whl/torch_stable.html
ERROR: Could not find a version that satisfies the requirement torch==1.9.0+cpu (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu102, 1.11.0+cu113, 1.11.0+cu115, 1.11.0+rocm4.3.1, 1.11.0+rocm4.5.2, 1.12.0, 1.12.0+cpu, 1.12.0+cu102, 1.12.0+cu113, 1.12.0+cu116, 1.12.0+rocm5.0, 1.12.0+rocm5.1.1, 1.12.1, 1.12.1+cpu, 1.12.1+cu102, 1.12.1+cu113, 1.12.1+cu116, 1.12.1+rocm5.0, 1.12.1+rocm5.1.1, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.0+cu117.with.pypi.cudnn, 1.13.0+rocm5.1.1, 1.13.0+rocm5.2, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117, 1.13.1+cu117.with.pypi.cudnn, 1.13.1+rocm5.1.1, 1.13.1+rocm5.2, 2.0.0, 2.0.0+cpu, 2.0.0+cpu.cxx11.abi, 2.0.0+cu117, 2.0.0+cu117.with.pypi.cudnn, 2.0.0+cu118, 2.0.0+rocm5.3, 2.0.0+rocm5.4.2, 2.0.1, 2.0.1+cpu, 2.0.1+cpu.cxx11.abi, 2.0.1+cu117, 2.0.1+cu117.with.pypi.cudnn, 2.0.1+cu118, 2.0.1+rocm5.3, 2.0.1+rocm5.4.2, 2.1.0, 2.1.0+cpu, 2.1.0+cpu.cxx11.abi, 2.1.0+cu118, 2.1.0+cu121, 2.1.0+cu121.with.pypi.cudnn, 2.1.0+rocm5.5, 2.1.0+rocm5.6)
ERROR: No matching distribution found for torch==1.9.0+cpu

Is there any way to update this version or ignore the version so that this can install correctly?

Describe how you solve it


Environment

  • jina 3.22.4
  • docarray 0.21.0
  • jcloud 0.3
  • jina-hubble-sdk 0.39.0
  • jina-proto 0.1.27
  • protobuf 4.24.3
  • proto-backend upb
  • grpcio 1.47.5
  • pyyaml 6.0
  • python 3.10.12
  • platform Linux
  • platform-release 5.10.192-183.736.amzn2.x86_64
  • platform-version #1 SMP Wed Sep 6 21:15:41 UTC 2023
  • architecture x86_64
  • processor x86_64
  • uid 3083049066853
  • session-id 20a184b4-7982-11ee-9c84-02cdd40b6165
  • uptime 2023-11-02T13:17:09.019222
  • ci-vendor (unset)
  • internal False
  • JINA_DEFAULT_HOST (unset)
  • JINA_DEFAULT_TIMEOUT_CTRL (unset)
  • JINA_DEPLOYMENT_NAME (unset)
  • JINA_DISABLE_UVLOOP (unset)
  • JINA_EARLY_STOP (unset)
  • JINA_FULL_CLI (unset)
  • JINA_GATEWAY_IMAGE (unset)
  • JINA_GRPC_RECV_BYTES 4120095
  • JINA_GRPC_SEND_BYTES 3172175
  • JINA_HUB_NO_IMAGE_REBUILD (unset)
  • JINA_LOG_CONFIG (unset)
  • JINA_LOG_LEVEL (unset)
  • JINA_LOG_NO_COLOR (unset)
  • JINA_MP_START_METHOD (unset)
  • JINA_OPTOUT_TELEMETRY (unset)
  • JINA_RANDOM_PORT_MAX (unset)
  • JINA_RANDOM_PORT_MIN (unset)
  • JINA_LOCKS_ROOT (unset)
  • JINA_K8S_ACCESS_MODES (unset)
  • JINA_K8S_STORAGE_CLASS_NAME (unset)
  • JINA_K8S_STORAGE_CAPACITY (unset)
  • JINA_STREAMER_ARGS (unset)

Screenshots

Can you please share the Flow or Deplpyment YAML u are trying to use?

I am trying to work through the following example notebook:

https://colab.research.google.com/github/jina-ai/workshops/blob/main/pdf_search/pdf_search.ipynb#scrollTo=J5F_waOoQS-7

When I get to the "Encode the text" step and add the Encoder, then attempt to call

with flow:
  docs = flow.index(docs, show_progress=True)

is where the error occurs.

Hopefully this helps. I am new to Jina so still learning my way around.

Apparently, the dependencies seem only to be available for Python 3.7 and not for Python 3.10. We are not mantaining these Hub Executors anymore, but u can try to change the requirements to newer pytorch versions

Should I be looking at alternate functionality to achieve what is done in this Notebook? Sounds like Hub Executors may not be the way to go. As mentioned, I am new to Jina so just trying to get my bearings with the product.

I think the best way to get ur hands in the project is to follow the examples in the README to understand the main concepts, and try to build your own services using it

@jina-ai/product This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days