Skip to content

run error: ValueError: Incorrect number of features. Got 128 features, expected 384 #21

Description

@michaelzph

when I run the script:

files = ['./00002.jpg']
pcr = PCR()
pcr.loadModel('model.bin')
pred = pcr.predict(files)

error occured. Can you help me?

Traceback (most recent call last):
File "test_case.py", line 16, in
test()
File "test_case.py", line 12, in test
pred = pcr.predict(files)
File "./PornDetector/pcr.py", line 122, in predict
clusters = self._kmeans.predict(totalDescriptors)
File "/home/work/miniconda2/envs/lab_v2/lib/python3.6/site-packages/sklearn/cluster/k_means
.py", line 1358, in predict
X = self.check_test_data(X)
File "/home/work/miniconda2/envs/lab_v2/lib/python3.6/site-packages/sklearn/cluster/k_means
.py", line 704, in _check_test_data
n_features, expected_n_features))
ValueError: Incorrect number of features. Got 128 features, expected 384

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions