Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a pre-trained model nessary? #739

Closed
YMkai opened this issue Dec 23, 2019 · 2 comments
Closed

If a pre-trained model nessary? #739

YMkai opened this issue Dec 23, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@YMkai
Copy link

YMkai commented Dec 23, 2019

🚀 If a pre-trained model nessary?

I changed the cfg and the model structure,so now I have no pre-trained model to use ,regards of this situation,I trianed the model directly but it occurred some errors which showed below ,my question is that can I train the model without pre-trained model ?Thank you for your help.

I used this:
python train.py --data data/spot.data --cfg cfg/yolov3.cfg --epochs 10

Here is an error.

Namespace(accumulate=4, adam=False, arc='default', batch_size=16, bucket='', cache_images=False, cfg='cfg/yolov3.cfg', data='data/spot.data', device='', epochs=10, evolve=False, img_size=416, img_weights=False, multi_scale=False, name='', nosave=False, notest=False, prebias=False, rect=False, resume=False, transfer=False, var=None, weights='weights/ultralytics68.pt')
Using CPU

/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:523: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:524: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:526: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:527: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
/home/nb505/.local/lib/python3.6/site-packages/tensorflow/python/framework/dtypes.py:532: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
Traceback (most recent call last):
File "train.py", line 115, in train
chkpt['model'] = {k: v for k, v in chkpt['model'].items() if model.state_dict()[k].numel() == v.numel()}
File "train.py", line 115, in
chkpt['model'] = {k: v for k, v in chkpt['model'].items() if model.state_dict()[k].numel() == v.numel()}
KeyError: 'module_list.85.Conv2d.weight'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train.py", line 463, in
train() # train normally
File "train.py", line 120, in train
raise KeyError(s) from e
KeyError: "weights/ultralytics68.pt is not compatible with cfg/yolov3.cfg. Specify --weights '' or specify a --cfg compatible with weights/ultralytics68.pt. See #657"

Thank you very much for helping me!

@YMkai YMkai added the enhancement New feature or request label Dec 23, 2019
@developer0hye
Copy link
Contributor

python3 train.py --weights '' --cfg cfg/*.cfg # any cfg will work here

Try this one!

@glenn-jocher
Copy link
Member

@mingkaaaaaai as the error message already states, use --weights ''. This will load no weights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants