Coder Social home page Coder Social logo

报错 about gaitset HOT 8 CLOSED

abnerhqc avatar abnerhqc commented on August 19, 2024
报错

from gaitset.

Comments (8)

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

难道是我的python版本是3.5才报错的吗?

from gaitset.

AbnerHqC avatar AbnerHqC commented on August 19, 2024

我没记错的话random应该是一个Python自带的包。你可以单独调试一下random.choices()

from gaitset.

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

我把choices改成choice之后又报错了,说choice接收了一个unexpected的值:k,如果我换成python3.6,是不是就会解决这个问题了呢?

from gaitset.

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

我换成Python3.6之后,就能运行了,谢谢你。

from gaitset.

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

Unfortunately, I have encountered new problems:
Traceback (most recent call last):
File "/pycharmProject/GaitSet-master/train.py", line 21, in
m.fit()
File "/pycharmProject/GaitSet-master/model/model.py", line 150, in fit
for seq, view, seq_type, label, batch_frame in train_loader:
File "/home/tbb/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in iter
return _DataLoaderIter(self)
File "/home/tbb/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 584, in init
self._put_indices()
File "/home/tbb/.local/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 646, in _put_indices
indices = next(self.sample_iter, None)
File "/pycharmProject/GaitSet-master/model/utils/sampler.py", line 15, in iter
self.batch_size[0])
File "/usr/lib/python3.6/random.py", line 320, in sample
raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative

from gaitset.

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

我知道怎么解决了,因为GPU显存小,训练的样本少,config里面设置的一次训练的个数超出了。谢谢。

from gaitset.

tangbinbinyes avatar tangbinbinyes commented on August 19, 2024

请问,这两个参数有什么用?
'pid_num': 73,
'pid_shuffle': False,

from gaitset.

AbnerHqC avatar AbnerHqC commented on August 19, 2024

您好,pid_num是选取前多少个人的样本用于训练。shuffle在casia上没有用,是说分割train和test的时候id是顺序的还是shuffle过的。

另外,上面你提到那个报错,应该和gpu没什么关系。是说你一个batch希望取出的人数大于了总的人数。config中batch_size第一维是每次取出的id数,第二维是每个id取的样本数。以pid_num=73为例,batch_size第一维应小于等于73。

很抱歉random.choices存在兼容性问题,感谢你提出这一问题。我会在后面的更新中更换这一函数,尽量使代码在Python3各个版本上都适用。

from gaitset.

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.