Skip to content

Using the pretrained model gives error #4

@mortium91

Description

@mortium91

Hi, i'm trying to test with the pretrained model mentioned here #2

However running the GUIGAN_test.py gives me an error. Not sure what i'm doing wrong.

Error:

Namespace(cuda=0)
opt.cuda is not None
Namespace(cuda=0)
opt.cuda is not None

c_cats: ['Books & Reference']

loading data

Loading time for the SubTrees in training data:0.904341 s

Time for loading training embedding:0.905231 s
NEGATIVE_FILE: results/Books & Reference

subtrees_count: 2183
train_templates_count: 1167

Time for getting Repository:0.022107 s

Time for loading real world data:0.345559 s

GENERATED_NUM,real_data_id1 303

VOCAB_SIZE: 2194
real_vocab_size: 2183

Time for unifying x_info and x_emb:0.098170 s

Traceback (most recent call last):
File "GUIGAN_test.py", line 237, in
reduced_data1 = PCA(n_components=2).fit_transform(x_emb)
File "/usr/local/lib/python3.7/dist-packages/sklearn/decomposition/_pca.py", line 369, in fit_transform
U, S, V = self._fit(X)
File "/usr/local/lib/python3.7/dist-packages/sklearn/decomposition/_pca.py", line 391, in _fit
copy=self.copy)
File "/usr/local/lib/python3.7/dist-packages/sklearn/utils/validation.py", line 556, in check_array
"if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

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