{
  "id": 393469,
  "title": "issue with the model - asking for help",
  "url": "/competitions/birdclef-2023/discussion/393469",
  "author_name": "",
  "post_date": "2023-03-09T14:30:45.589310900Z",
  "votes": 2,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Just trying something quick from Kaggle/Models. Have issues.</p>\n<pre><code> tensorflow_hub  hub\n\n\nmodel = hub.load()\n\n\nwaveform = np.zeros( * , dtype=np.float32)\n\n\nlogits, embeddings = model(waveform)\n</code></pre>\n<p>-&gt; </p>\n<hr>\n<p>TypeError                                 Traceback (most recent call last)<br>\n/tmp/ipykernel_27/203872764.py in <br>\n      8 <br>\n      9 # Run the model, check the output.<br>\n---&gt; 10 logits, embeddings = model(waveform)</p>\n<p>TypeError: '_UserObject' object is not callable</p>",
  "messages": [
    {
      "id": "2174949",
      "postDate": "03/09/2023 14:30:45",
      "content": "<p>Just trying something quick from Kaggle/Models. Have issues.</p>\n<pre><code> tensorflow_hub  hub\n\n\nmodel = hub.load()\n\n\nwaveform = np.zeros( * , dtype=np.float32)\n\n\nlogits, embeddings = model(waveform)\n</code></pre>\n<p>-&gt; </p>\n<hr>\n<p>TypeError                                 Traceback (most recent call last)<br>\n/tmp/ipykernel_27/203872764.py in <br>\n      8 <br>\n      9 # Run the model, check the output.<br>\n---&gt; 10 logits, embeddings = model(waveform)</p>\n<p>TypeError: '_UserObject' object is not callable</p>",
      "rawMarkdown": "Just trying something quick from Kaggle/Models. Have issues.\n\n```python\nimport tensorflow_hub as hub\n\n# Load the model.\nmodel = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')\n\n# Input: 5 seconds of silence as mono 32 kHz waveform samples.\nwaveform = np.zeros(5 * 32000, dtype=np.float32)\n\n# Run the model, check the output.\nlogits, embeddings = model(waveform)\n```\n\n-> \n\n---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_27/203872764.py in <module>\n      8 \n      9 # Run the model, check the output.\n---> 10 logits, embeddings = model(waveform)\n\nTypeError: '_UserObject' object is not callable",
      "votes": null
    },
    {
      "id": "2175043",
      "postDate": "03/09/2023 15:57:39",
      "content": "<p>Let's try:</p>\n<p>`import tensorflow_hub as hub</p>\n<h1>Load the model.</h1>\n<p>model = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')</p>\n<h1>Input: 5 seconds of silence as mono 32 kHz waveform samples.</h1>\n<p>waveform = np.zeros(5 * 32000, dtype=np.float32).reshape(1,-1)</p>\n<h1>Run the model, check the output.</h1>\n<p>logits, embeddings = model.infer_tf(waveform)`</p>",
      "rawMarkdown": "Let's try:\n\n`import tensorflow_hub as hub\n\n# Load the model.\nmodel = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')\n\n# Input: 5 seconds of silence as mono 32 kHz waveform samples.\nwaveform = np.zeros(5 * 32000, dtype=np.float32).reshape(1,-1)\n\n# Run the model, check the output.\nlogits, embeddings = model.infer_tf(waveform)`",
      "votes": null
    },
    {
      "id": "2175418",
      "postDate": "03/09/2023 20:38:01",
      "content": "<p>Good catch! I've reached out to the TFHub team to update the instructions to run the model with <code>model.infer_tf</code>.</p>",
      "rawMarkdown": "Good catch! I've reached out to the TFHub team to update the instructions to run the model with `model.infer_tf`.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 2175043,
      "author_name": "bibanh",
      "author_url": "",
      "post_date": "03/09/2023 15:57:39",
      "content": "<p>Let's try:</p>\n<p>`import tensorflow_hub as hub</p>\n<h1>Load the model.</h1>\n<p>model = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')</p>\n<h1>Input: 5 seconds of silence as mono 32 kHz waveform samples.</h1>\n<p>waveform = np.zeros(5 * 32000, dtype=np.float32).reshape(1,-1)</p>\n<h1>Run the model, check the output.</h1>\n<p>logits, embeddings = model.infer_tf(waveform)`</p>",
      "votes": null,
      "replies": [
        {
          "id": 2175418,
          "author_name": "tomdenton",
          "author_url": "",
          "post_date": "03/09/2023 20:38:01",
          "content": "<p>Good catch! I've reached out to the TFHub team to update the instructions to run the model with <code>model.infer_tf</code>.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "2174949": "Just trying something quick from Kaggle/Models. Have issues.\n\n```python\nimport tensorflow_hub as hub\n\n# Load the model.\nmodel = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')\n\n# Input: 5 seconds of silence as mono 32 kHz waveform samples.\nwaveform = np.zeros(5 * 32000, dtype=np.float32)\n\n# Run the model, check the output.\nlogits, embeddings = model(waveform)\n```\n\n-> \n\n---------------------------------------------------------------------------\nTypeError                                 Traceback (most recent call last)\n/tmp/ipykernel_27/203872764.py in <module>\n      8 \n      9 # Run the model, check the output.\n---> 10 logits, embeddings = model(waveform)\n\nTypeError: '_UserObject' object is not callable",
    "2175043": "Let's try:\n\n`import tensorflow_hub as hub\n\n# Load the model.\nmodel = hub.load('https://kaggle.com/models/google/bird-vocalization-classifier/frameworks/tensorFlow2/variations/bird-vocalization-classifier/versions/1')\n\n# Input: 5 seconds of silence as mono 32 kHz waveform samples.\nwaveform = np.zeros(5 * 32000, dtype=np.float32).reshape(1,-1)\n\n# Run the model, check the output.\nlogits, embeddings = model.infer_tf(waveform)`",
    "2175418": "Good catch! I've reached out to the TFHub team to update the instructions to run the model with `model.infer_tf`."
  },
  "source": "meta"
}