0
from rembg import remove
from PIL import Image
input_path = 'input.png'
output_path = 'output.png'
input = Image.open(input_path)
output = remove(input)
output.save(output_path)

I get an error

sess = C.InferenceSession(session_options, self._model_path, True, self._read_config_from_model)
onnxruntime.capi.onnxruntime_pybind11_state.NoSuchFile: [ONNXRuntimeError] : 3 : NO_SUCHFILE : Load model from C:\Users\User\.u2net\u2net.onnx failed:Load model C:\Users\User\.u2net\u2net.onnx failed. File doesn't exist

I can't figure out what's wrong, I checked everything

Tzane
  • 2,752
  • 1
  • 10
  • 21
AleksRous
  • 3
  • 1

1 Answers1

0

https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net.onnx

Make sure that after the download is completed, copy U2Net.onnx to C: \ Users \ <your username> . u2net \ this folder Then reopen the code.

starball
  • 20,030
  • 7
  • 43
  • 238
QinYu
  • 1
  • 1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/34840753) – doneforaiur Aug 18 '23 at 10:19