Open tgbamg opened 6 years ago
It's not necessary to change the number of CLASSES. Change the CLASSES, the number of CLASSES change automatically.
@leeyoshinari Your default CLASSES has 20 items, I just change the CLASSES with 40 items, without changing any other things. But the Error occured as I mentioned above. Should I change the size of the net?
@leeyoshinari Here is the full log:
C:\pycharm_projects\yolo_tiny>python train.py
WARNING:tensorflow:From C:\pycharm_projects\yolo_tiny\yolo\yolo_net.py:139: calling reduce_max (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
2018-07-19 14:34:41.731424: I c:\users\user\source\repos\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2
2018-07-19 14:34:42.326276: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1356] Found device 0 with properties:
name: GeForce GTX 1060 major: 6 minor: 1 memoryClockRate(GHz): 1.733
pciBusID: 0000:01:00.0
totalMemory: 6.00GiB freeMemory: 4.97GiB
2018-07-19 14:34:42.326364: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1435] Adding visible gpu devices: 0
2018-07-19 14:34:42.814056: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:923] Device interconnect StreamExecutor with strength 1 edge matrix:
2018-07-19 14:34:42.814125: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:929] 0
2018-07-19 14:34:42.814903: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:942] 0: N
2018-07-19 14:34:42.815038: I c:\users\user\source\repos\tensorflow\tensorflow\core\common_runtime\gpu\gpu_device.cc:1053] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 4743 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1060, pci bus id: 0000:01:00.0, compute capability: 6.1)
Restore weights from: C:\pycharm_projects\yolo_tiny\data\output\YOLO_tiny.ckpt
Traceback (most recent call last):
File "train.py", line 167, in
Caused by op u'save/Assign_23', defined at:
File "train.py", line 167, in
InvalidArgumentError (see above for traceback): Assign requires shapes of both tensors to match. lhs shape= [4096,2450] rhs shape= [4096,1470] [[Node: save/Assign_23 = Assign[T=DT_FLOAT, _class=["loc:@local3/weights"], use_locking=true, validate_shape=true, _device="/job:localhost/replica:0/task:0/device:CPU:0"](local3/weights, save/RestoreV2:23)]] [[Node: save/RestoreV2/_249 = _Recv[client_terminated=false, recv_device="/job:localhost/replica:0/task:0/device:GPU:0", send_device="/job:localhost/replica:0/task:0/device:CPU:0", send_device_incarnation=1, tensor_name="edge_22_save/RestoreV2", tensor_type=DT_FLOAT, _device="/job:localhost/replica:0/task:0/device:GPU:0"]()]]
Don't restore the weight of the last layer when you begin to train the net.
I could not find the weight of the last layer. Should I change the .ckpt file? Where and what should I change? Can you tell me more details? Thanks a lot.
Modify train.py. Comment out line 35, and use line 36 and line 66. In line 36, the '-3' means the last three variables don't restore. You can try to change it to '-1', '-2', '-5' or others.
@leeyoshinari I change it to '-2', it works fine now. Thanks a lot! I want to draw the box with red and bolder lines in the test.py file, which line should I change and how to change it?
In test.py, you should modify the function of 'draw_result', you need to know opencv.
@leeyoshinari Thanks! My CLASSES have 20 items. If I want to train on my own dataset, how many pictures should I have in the dataset at least?
The more, the better. But need to note the distribution of data.
The distribution of my data is Uniform distribution. Is that ok?
OK
@leeyoshinari Thanks a lot!
@tgbamg have you trained any model by using this code?
When I try to change the numbers of CLASSES, the program produces an error:
"tensorflow.python.framework.errors_impl.InvalidArgumentError: Assign requires shapes of both tensors to match. lhs shape= [14351,128] rhs shape= [70450,128] "
How could I solve this?