Git Product home page Git Product logo

Comments (5)

TitusTom avatar TitusTom commented on July 17, 2024 1

I'm having the same issue. Any luck fixing this?

Edit: I managed to solve this. A blank line in my file was the cause of this.

from skip-thoughts.

Pratyusha1796 avatar Pratyusha1796 commented on July 17, 2024

I'm having same issue can you help me with how to fix that?
ng f_log_probs... Done
Building f_cost... Done
Done
Building f_grad... Building optimizers... Optimization
Epoch 0

ValueError Traceback (most recent call last)
in ()
1 import train
----> 2 train.trainer (X)

/home/pratyusha/Documents/skip-thoughts/training/train.py in trainer(X, dim_word, dim, encoder, decoder, max_epochs, dispFreq, decay_c, grad_clip, n_words, maxlen_w, optimizer, batch_size, saveto, dictionary, saveFreq, reload_)
155 x, x_mask, y, y_mask, z, z_mask = homogeneous_data.prepare_data(x, y, z, worddict, maxlen=maxlen_w, n_words=n_words)
156
--> 157 if x == None:
158 print 'Minibatch with zero sample under length ', maxlen_w
159 uidx -= 1

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

could any one help me?
Thank you

from skip-thoughts.

afrozas avatar afrozas commented on July 17, 2024

@Pratyusha1796
Change x == None in training/train.py to
x.any() == None or x.all() == None.

from skip-thoughts.

abhilasha23 avatar abhilasha23 commented on July 17, 2024

I'm having the same issue. Any luck fixing this?

Edit: I managed to solve this. A blank line in my file was the cause of this.

Hi @TitusTom : Can you please help me with which file did you fix to fix this issue?

from skip-thoughts.

AkshayVaghani avatar AkshayVaghani commented on July 17, 2024

I am getting following error , can anyone please help ,

vectors = encoder.encode(['love is good'])


TypeError Traceback (most recent call last)
in ()
----> 1 vectors = encoder.encode(['love is good'])

~/Downloads/skip-thoughts-master/skipthoughts.py in encode(self, X, use_norm, verbose, batch_size, use_eos)
123 Encode sentences in the list X. Each entry will return a vector
124 """
--> 125 return encode(self._model, X, use_norm, verbose, batch_size, use_eos)
126
127

~/Downloads/skip-thoughts-master/skipthoughts.py in encode(model, X, use_norm, verbose, batch_size, use_eos)
151 print(k)
152 numbatches = len(ds[k]) / batch_size + 1
--> 153 for minibatch in range(numbatches):
154 caps = ds[k][minibatch::numbatches]
155

TypeError: 'float' object cannot be interpreted as an integer

from skip-thoughts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.