# weaviate.exceptions.UnexpectedStatusCodeException: batch response! Unexpected status code: 400, with response body: {'code': 400, 'message': 'parsing body body from "" failed, because json: cannot unmarshal array into Go struct field Object.objects.vector

**URL:** <https://forum.weaviate.io/t/weaviate-exceptions-unexpectedstatuscodeexception-batch-response-unexpected-status-code-400-with-response-body-code-400-message-parsing-body-body-from-failed-because-json-cannot-unmarshal-array-into-go-struct-field-object-objects-vector/1726>\
**Category:** Support\
**Tags:** python\
**Created:** [March 15, 2024, 11:02am UTC](https://forum.weaviate.io/t/weaviate-exceptions-unexpectedstatuscodeexception-batch-response-unexpected-status-code-400-with-response-body-code-400-message-parsing-body-body-from-failed-because-json-cannot-unmarshal-array-into-go-struct-field-object-objects-vector/1726 "2024-03-15T11:02:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [March 15, 2024, 11:02am UTC](https://forum.weaviate.io/t/weaviate-exceptions-unexpectedstatuscodeexception-batch-response-unexpected-status-code-400-with-response-body-code-400-message-parsing-body-body-from-failed-because-json-cannot-unmarshal-array-into-go-struct-field-object-objects-vector/1726/1 "2024-03-15T11:02:07Z")

</div>

from gensim.models.doc2vec import Doc2Vec, TaggedDocument  
from nltk.tokenize import word\_tokenize

def embedder(chunks):  
# Preprocess the documents and create TaggedDocuments  
tagged\_data = [TaggedDocument(words=word\_tokenize(chunk.lower()), tags=[str(i)]) for i, chunk in enumerate(chunks)]

```
# Train the Doc2Vec model
model = Doc2Vec(vector_size=100, min_count=1)
model.build_vocab(tagged_data)
model.train(tagged_data, total_examples=model.corpus_count, epochs=model.epochs)

# Verify the vector size
print("Vector size:", model.vector_size)

embeddings = []

for i, chunk in enumerate(chunks):
    # Infer vector for the entire chunk
    chunk_vector = model.infer_vector(word_tokenize(chunk.lower()))
    embeddings.append(chunk_vector)

return embeddings

```

This is my embedding that goes in a chunking code. When i saved my chunk and vector in a json file i ask. I wanted to save it in a weavite database.

import weaviate  
import json  
import pprint  
f = open(‘data.json’)  
data = json.load(f)

client = weaviate.Client(  
url = “[http://10.0.129.19:8888](http://10.0.129.19:8888)”, # Replace with your endpoint  
)

# Configure a batch process

client.batch.configure(batch\_size=100) # Configure batch  
with client.batch as batch:  
# Batch import all Questions  
for i, d in enumerate(data):  
print(f"importing answers: {i+1}")

```
    # pprint.pprint(d["Answer"])
    properties = {
        "answer": d["Answer"]
    }

    batch.add_data_object(properties, "QWERTY", vector=d["Vector"])

```

in this code what worked with a other embedding. Is it my embedding code?

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [March 15, 2024, 2:12pm UTC](https://forum.weaviate.io/t/weaviate-exceptions-unexpectedstatuscodeexception-batch-response-unexpected-status-code-400-with-response-body-code-400-message-parsing-body-body-from-failed-because-json-cannot-unmarshal-array-into-go-struct-field-object-objects-vector/1726/2 "2024-03-15T14:12:11Z")

</div>

Hi!

This indeed seems like a bad vector ingestion.

What is the version you are running?

can you make sure that d[“Vector”] has a valid vector?

also, can you manually replace it with a known vector?

Thanks!
