Code Monkey home page Code Monkey logo

Comments (4)

junjiejiangjjj avatar junjiejiangjjj commented on July 30, 2024

We have released Towhee 1.1.1, it uses the correct version of pydantic

from examples.

595972434 avatar 595972434 commented on July 30, 2024

I am using towhee=1.1.1, the example of Reverse Image Search still has issue.
I tried this notebook, everything works well except the step of # Display search results with images, no need for implementation

Here is the error details. I think it might be related to pydantic. I have checked the version of it, I do use pydantic =1.10.10

Cell In[36], line 13
      9         imgs.append(Image(cv2.imread(p), 'BGR'))
     10     return imgs
     12 p_search_img = (
---> 13     p_search_pre.map('pred', 'pred images', read_images)
     14                 .output('img', 'pred images')
     15 )
     16 DataCollection(p_search_img('test/goldfish/*.JPEG')).show()

File [~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/towhee/runtime/pipeline.py:123](https://file+.vscode-resource.vscode-cdn.net/Users/REA_bin.wang/Documents/self-project/milvus/~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/towhee/runtime/pipeline.py:123), in Pipeline.map(self, input_schema, output_schema, fn, config)
    104 def map(self, input_schema, output_schema, fn, config=None) -> 'Pipeline':
    105     """
    106     One to one map of function on inputs.
    107 
   (...)
    121         [1, 2]
    122     """
--> 123     output_schema = self._check_schema(output_schema)
    124     input_schema = self._check_schema(input_schema)
    126     uid = uuid.uuid4().hex

File [~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/towhee/runtime/pipeline.py:517](https://file+.vscode-resource.vscode-cdn.net/Users/REA_bin.wang/Documents/self-project/milvus/~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/towhee/runtime/pipeline.py:517), in Pipeline._check_schema(schema)
    515 @staticmethod
...
File [~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/pydantic/main.py:341](https://file+.vscode-resource.vscode-cdn.net/Users/REA_bin.wang/Documents/self-project/milvus/~/Documents/self-project/milvus/venv/lib/python3.10/site-packages/pydantic/main.py:341), in pydantic.main.BaseModel.__init__()

ValidationError: 1 validation error for TupleForm
schema_data -> 0
  string does not match regex "^[a-z][a-z0-9_]*$" (type=value_error.str.regex; pattern=^[a-z][a-z0-9_]*$)

from examples.

595972434 avatar 595972434 commented on July 30, 2024

Sorry for raising this issue, I am a beginner of towhee. It seem the previous error is caused by those lines

p_search_img = (
    p_search_pre.map('pred', 'pred images', read_images)
                .output('img', 'pred images')

the schema does not support space, replace pred images with pred_images could solve this issue

from examples.

jaelgu avatar jaelgu commented on July 30, 2024

Sorry for raising this issue, I am a beginner of towhee. It seem the previous error is caused by those lines

p_search_img = (
    p_search_pre.map('pred', 'pred images', read_images)
                .output('img', 'pred images')

the schema does not support space, replace pred images with pred_images could solve this issue

Fixed by #220

from examples.

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.