How to handle errors in arrays and sequence?

左心房为你撑大大i 提交于 2021-02-11 18:21:32

问题


I am trying to find the similarity of documents. Referring to this github repo: https://github.com/s4sarath/Deep-Learning-Projects/blob/master/variational_text_inference/model_evaluation.ipynb

When I run this code:

        batch_size = 100
        H_20_grp_nws = []
        batch_data = A.get_batch(batch_size)
        batch_id = 0
        for batch_ in batch_data:

        batch_id += 1
        collected_data = [chunks for chunks in batch_]
        batch_xs , mask_xs , mask_negative  = A._bag_of_words(collected_data)


        feed_dict = {vae.X: batch_xs , vae.dynamic_batch_size:batch_xs.shape[0],
                                        vae.MASK:mask_xs}

        h_batch = feed_dict= feed_dict
        H_20_grp_nws.extend(h_batch)

H_20_grp_nws = np.array(H_20_grp_nws) from sklearn import manifold tsne = manifold.TSNE(n_components=2, init='pca', random_state=0) %time H_tsne = tsne.fit_transform(H_20_grp_nws) ########### Converting to tsne

I get an error: 'ValueError: setting an array element with a sequence'

can someone help me here?

来源:https://stackoverflow.com/questions/61406994/how-to-handle-errors-in-arrays-and-sequence

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!