Code Monkey home page Code Monkey logo

Comments (10)

mikel-brostrom avatar mikel-brostrom commented on June 13, 2024

It will be very hard to help you with this little information. Could you provide the complete error message?

from yolo_tracking.

YexiongLin avatar YexiongLin commented on June 13, 2024

self.update(yaml.load(fo.read()))
Using CUDA device0 _CudaDeviceProperties(name='GeForce MX150', total_memory=2002MB)

/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'models.yolo.Model' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'models.yolo.Detect' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
1/1: 0... success (640x480 at 30.00 FPS).

Traceback (most recent call last):
File "track.py", line 247, in
detect(args)
File "track.py", line 122, in detect
_ = model(img.half() if half else img) if device.type != 'cpu' else None # run once
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 110, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "./yolov5/models/yolo.py", line 130, in forward_once
x = m(x) # run
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 37, in forward
x[i] = self.mi # conv
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 594, in getattr
type(self).name, name))
AttributeError: 'Detect' object has no attribute 'm'
terminate called without an active exception

And pytorch=1.5.0 cuda=10.2 python=3.7
The reason why I use pytorch 1.5.0 is that I can not run original yolov5 when I update my pytorch to 1.6.0

from yolo_tracking.

YexiongLin avatar YexiongLin commented on June 13, 2024

self.update(yaml.load(fo.read()))
Using CUDA device0 _CudaDeviceProperties(name='GeForce MX150', total_memory=2002MB)

/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'models.yolo.Model' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'torch.nn.modules.conv.Conv2d' has changed. you can retrieve the source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
/home/lyx/anaconda3/lib/python3.7/site-packages/torch/serialization.py:657: SourceChangeWarning: source code of class 'models.yolo.Detect' has changed. you can retrieve the original source code by accessing the object's source attribute or set torch.nn.Module.dump_patches = True and use the patch tool to revert the changes.
warnings.warn(msg, SourceChangeWarning)
1/1: 0... success (640x480 at 30.00 FPS).

Traceback (most recent call last):
File "track.py", line 247, in
detect(args)
File "track.py", line 122, in detect
_ = model(img.half() if half else img) if device.type != 'cpu' else None # run once
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 110, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "./yolov5/models/yolo.py", line 130, in forward_once
x = m(x) # run
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 550, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 37, in forward
x[i] = self.mi # conv
File "/home/lyx/anaconda3/lib/python3.7/site-packages/torch/nn/modules/module.py", line 594, in getattr
type(self).name, name))
AttributeError: 'Detect' object has no attribute 'm'
terminate called without an active exception

And pytorch=1.5.0 cuda=10.2 python=3.7
The reason why I use pytorch 1.5.0 is that I can not run original yolov5 when I update my pytorch to 1.6.0

And I use python3.8 and pytorch 1.6.0, I met the same problem.

from yolo_tracking.

Dreamskya avatar Dreamskya commented on June 13, 2024

同样遇到这个问题,有人解决了吗?

from yolo_tracking.

Lamborxhini avatar Lamborxhini commented on June 13, 2024

Traceback (most recent call last):
File "track.py", line 247, in
detect(args)
File "track.py", line 122, in detect
_ = model(img.half() if half else img) if device.type != 'cpu' else None # run once
File "/home/jie311/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 100, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "./yolov5/models/yolo.py", line 120, in forward_once
x = m(x) # run
File "/home/jie311/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in call
result = self.forward(*input, **kwargs)
File "./yolov5/models/yolo.py", line 27, in forward
x[i] = self.mi # conv
File "/home/jie311/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py", line 591, in getattr
type(self).name, name))
AttributeError: 'Detect' object has no attribute 'm'

I encountered this problem, too. Need I upgrade my pytorch from 1.2.0 to 1.6.0 ? Or is it about my python version 3.6.10 ?Thanks @mikel-brostrom

请问有哪位大佬解决了这个问题么?可以的话交流一下谢谢!

from yolo_tracking.

mikel-brostrom avatar mikel-brostrom commented on June 13, 2024

Make sure that ALL the requirements are fulfilled: Python >= 3.8, PyTorch >= 1.6 etc.
Then make sure both your code and models are up to date. If in doubt, simply start from a clean slate: reclone the repo and download new weights

from yolo_tracking.

mikel-brostrom avatar mikel-brostrom commented on June 13, 2024

For more info on this specific error you could check:

from yolo_tracking.

Jiachenyin1 avatar Jiachenyin1 commented on June 13, 2024

For more info on this specific error you could check:

yes solve it Thx

from yolo_tracking.

mikel-brostrom avatar mikel-brostrom commented on June 13, 2024

I just updated yolov5. That may help as well

from yolo_tracking.

mikel-brostrom avatar mikel-brostrom commented on June 13, 2024

I encountered this same error myself yesterday while updating yolov5. I updated the code but didn't update the models, so... #10 (comment)

from yolo_tracking.

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.