Related
I am trying to train a model using Yolo V5.
I have the issue of Data base not found.
I have a train, test and valid files that contain all the image and labels files.
I have tested the files on googlecolap and it dose work. However, on my local machine it shows the issue of Exception: Dataset not found.
(Yolo_5) D:\\YOLO_V_5\Yolo_V5\yolov5>python train.py --img 416 --batch 8 --epochs 100 --data /data.yaml --cfg models/yolov5s.yaml --weights '' --name yolov5s_results --cache
Using torch 1.7.0 CUDA:0 (GeForce GTX 1080, 8192MB)
Namespace(adam=False, batch_size=8, bucket='', cache_images=True, cfg='models/yolov5s.yaml', data='.\\data.yaml', device='', epochs=100, evolve=False, exist_ok=False, global_rank=-1, hyp='data/hyp.scratch.yaml', image_weights=False, img_size=[416, 416], local_rank=-1, log_imgs=16, multi_scale=False, name='yolov5s_results', noautoanchor=False, nosave=False, notest=False, project='runs/train', rect=False, resume=False, save_dir='runs\\train\\yolov5s_results55', single_cls=False, sync_bn=False, total_batch_size=8, weights="''", workers=16, world_size=1)
Start Tensorboard with "tensorboard --logdir runs/train", view at http://localhost:6006/
Hyperparameters {'lr0': 0.01, 'lrf': 0.2, 'momentum': 0.937, 'weight_decay': 0.0005, 'warmup_epochs': 3.0, 'warmup_momentum': 0.8, 'warmup_bias_lr': 0.1, 'box': 0.05, 'cls': 0.5, 'cls_pw': 1.0, 'obj': 1.0, 'obj_pw': 1.0, 'iou_t': 0.2, 'anchor_t': 4.0, 'anchors': 3, 'fl_gamma': 0.0, 'hsv_h': 0.015, 'hsv_s': 0.7, 'hsv_v': 0.4, 'degrees': 0.0, 'translate': 0.1, 'scale': 0.5, 'shear': 0.0, 'perspective': 0.0, 'flipud': 0.0, 'fliplr': 0.5, 'mosaic': 1.0, 'mixup': 0.0}
WARNING: Dataset not found, nonexistent paths: ['D:\\me1eye\\Yolo_V5\\valid\\images']
Traceback (most recent call last):
File "train.py", line 501, in <module>
train(hyp, opt, device, tb_writer, wandb)
File "train.py", line 78, in train
check_dataset(data_dict) # check
File "D:\me1eye\YOLO_V_5\Yolo_V5\yolov5\utils\general.py", line 92, in check_dataset
raise Exception('Dataset not found.')
Exception: Dataset not found.
Internal process exited
(Olive_Yolo_5) D:\me1eye\YOLO_V_5\Yolo_V5\yolov5>
there is a much simpler solution. Just go into data.yaml wherever you saved it and change the relative paths to absolut - i.e. just write the whole path! e.g.
train: C:\hazlab\BCCD\train\images
val: C:\hazlab\BCCD\valid\images
nc: 3
names: ['Platelets', 'RBC', 'WBC']
job done - note, as you are in Windows, there is a known issue in the invocation of tain.py - do not use quotes on the file names in the CLI e.g.
!python train.py --img 416 --batch 16 --epochs 100 --data C:\hazlab\BCCD\data.yaml --cfg ./models/custom_yolov5s.yaml --weights '' --name yolov5s_results --cache
Well! I have also encountered this problem and now I fix it.
All you have to do is to keep train, test, validation (these three folders containing images and labels), and yolov5 folder (that is cloned from GitHub) in the same directory. Also, another thing is that the 'data.yaml' file has to be inside the yolov5 folder.
Command to train the model would be like this:
!python train.py --img 416 --batch 16 --epochs 10 --data ./data.yaml --cfg ./models/yolov5m.yaml --weights '' --name yolov5m_results
The issue is due to not found actual dataset path. I found same issue when i trained the Yolov5 model on custom dataset using google colab, I did the following to resolve this.
Make sure provide correct path of data.yaml of dataset.
Make sure path of dataset in data.yaml should be be corrected.
train, test, and valid key should contain path with respect to the main path of the dataset.
Example data.yaml file given below.
path: /content/drive/MyDrive/car-detection-dataset
train: train/images
val: valid/images
test: test/images
nc: 1
names: ['car']
While doing my project migration from Tcl 8.5.9/Itcl 3.4 to Tcl 8.6.6/Itcl 4.0.5 I've faced with inconsistency of $this variable depending how it's accessed. Here is the minimized testcase:
puts "Tcl version : $tcl_patchLevel"
puts "Itcl version : [package require Itcl]"
itcl::class Base {
public {
method base_process {script} {
uplevel $m_main main_process [list $script]
}
method set_main {main} {
set m_main $main
}
}
protected {
variable m_main
}
}
itcl::class Main {
inherit Base
public {
method main_process {script} {
uplevel $script
}
}
}
itcl::class Worker {
inherit Base
public {
method worker_process_direct {} {
puts "Direct query: this = $this"
}
method worker_process_inderect {} {
base_process {puts "Indirect query: this = $this"}
}
method worker_process_both {} {
puts "Direct query: this = $this"
base_process {puts "Indirect query: this = $this"}
}
}
}
Main main
Worker worker
worker set_main main
puts "\n==== worker_process_direct ===="
worker worker_process_direct
puts "\n==== worker_process_indirect ===="
worker worker_process_inderect
puts "\n==== worker_process_both ===="
worker worker_process_both
worker_process_direct and worker_process_both functions always provide correct results. But worker_process_inderect works correctly only with old version of Tcl/Itcl. For Tcl 8.6.6/Itcl 4.0.5 $this variable is strangely changed to the instance of Main class instead of Worker.
Here is the output of the script above for two versions of Tcl/Itcl.
Tcl version : 8.5.9
Itcl version : 3.4
==== worker_process_direct ====
Direct query: this = ::worker
==== worker_process_indirect ====
Indirect query: this = ::worker <<<<<<<<<<<< CORRECT
==== worker_process_both ====
Direct query: this = ::worker
Indirect query: this = ::worker
Tcl version : 8.6.6
Itcl version : 4.0.5
==== worker_process_direct ====
Direct query: this = ::worker
==== worker_process_indirect ====
Indirect query: this = ::main <<<<<<<<<< INCORRECT
==== worker_process_both ====
Direct query: this = ::worker
Indirect query: this = ::worker
Did I miss something and there were significant changes in Tcl/Itcl which I haven't noticed?
Now that is very curious! I augmented your script to define Main like this:
itcl::class Main {
inherit Base
public {
method main_process {script} {
uplevel $script
# Print what is actually going on!
puts >>[tcl::unsupported::disassemble script $script]<<
}
}
}
With 8.5/3.4 I get this output:
Tcl version : 8.5.9
Itcl version : 3.4
==== worker_process_direct ====
Direct query: this = ::worker
==== worker_process_indirect ====
Indirect query: this = ::worker
>>ByteCode 0x0x7fedea044c10, refCt 1, epoch 3, interp 0x0x7fedea033010 (epoch 3)
Source "puts \"Indirect query: this = $this\""
Cmds 1, src 35, inst 12, litObjs 3, aux 0, stkDepth 3, code/src 0.00
Commands 1:
1: pc 0-10, src 0-34
Command 1: "puts \"Indirect query: this = $this\""
(0) push1 0 # "puts"
(2) push1 1 # "Indirect query: this = "
(4) push1 2 # "this"
(6) loadScalarStk
(7) concat1 2
(9) invokeStk1 2
(11) done
<<
==== worker_process_both ====
Direct query: this = ::worker
Indirect query: this = ::worker
>>ByteCode 0x0x7fedea044c10, refCt 1, epoch 3, interp 0x0x7fedea033010 (epoch 3)
Source "puts \"Indirect query: this = $this\""
Cmds 1, src 35, inst 12, litObjs 3, aux 0, stkDepth 3, code/src 0.00
Commands 1:
1: pc 0-10, src 0-34
Command 1: "puts \"Indirect query: this = $this\""
(0) push1 0 # "puts"
(2) push1 1 # "Indirect query: this = "
(4) push1 2 # "this"
(6) loadScalarStk
(7) concat1 2
(9) invokeStk1 2
(11) done
<<
With 8.6/4.0 I get this instead:
Tcl version : 8.6.3
Itcl version : 4.0.2
==== worker_process_direct ====
Direct query: this = ::worker
==== worker_process_indirect ====
Indirect query: this = ::main
>>ByteCode 0x0x1009af010, refCt 1, epoch 136, interp 0x0x100829a10 (epoch 136)
Source "puts \"Indirect query: this = $this"...
Cmds 1, src 35, inst 12, litObjs 3, aux 0, stkDepth 3, code/src 0.00
Commands 1:
1: pc 0-10, src 0-34
Command 1: "puts \"Indirect query: this = $this"...
(0) push1 0 # "puts"
(2) push1 1 # "Indirect query: this = "
(4) push1 2 # "this"
(6) loadStk
(7) strcat 2
(9) invokeStk1 2
(11) done
<<
==== worker_process_both ====
Direct query: this = ::worker
Indirect query: this = ::worker
>>ByteCode 0x0x1009b0210, refCt 1, epoch 136, interp 0x0x100829a10 (epoch 136)
Source "puts \"Indirect query: this = $this"...
Cmds 1, src 35, inst 11, litObjs 2, aux 0, stkDepth 3, code/src 0.00
Commands 1:
1: pc 0-9, src 0-34
Command 1: "puts \"Indirect query: this = $this"...
(0) push1 0 # "puts"
(2) push1 1 # "Indirect query: this = "
(4) loadScalar1 %v0
(6) strcat 2
(8) invokeStk1 2
(10) done
<<
So, 8.5 uses the loadScalarStk instruction to read the variable in both (indirect) cases, whereas 8.6 uses loadStk and loadScalar1 to load the variable in the two cases. Which is mighty strange; I wouldn't expect loadScalar1 to appear in a script fragment (it needs a Local Variable Table) but at least it is picking up the expected value, whereas loadStk is just picking up the wrong value entirely. I've also tried using exactly the same value in the two places — with the script kept in a shared variable — but that produces the same output; it looks like in one place it is evaluating but picking up the wrong value (perhaps a variable resolver issue?) and in the other it is picking up the right value but for the wrong reasons (as the LVT shouldn't be used in a script fragment; that's for full procedures/methods only). Either way, it's Bad News.
Please file a bug report at http://core.tcl-lang.org/tcl/tktnew as this smells like several sorts of wrong behaviour compounded.
I have a problem parsing json data in a loop. Iam a clojure beginner and need some hint for looping through json data.
The data looks like this:
{"photoset" {"primary" "8455893107", "total" "2", "pages" 1, "perpage" 500, "page" 1,
"per_page" 500, "photo"
[{"id" "8455893107", "secret" "1a3236df06", "server" "8087",
"farm" 9, "title" "IMG_0137", "isprimary" "1"}
{"id" "8469482476", "secret" "4c1bf59214",
"server" "8235", "farm" 9, "title" "HippieBus", "isprimary" "0"}]
, "owner"
"93029076#N07", "id" "72157632724688181", "ownername" "clojureB5"}, "stat" "ok"}
What I want to do is loop through the two photos and build a new url with the id and farm value like http://www.flickr.com/farm/id
I know that I can get one value like this:
(-> (get-in (cheshire.core/parse-string (:body picList)) ["photoset" "photo"]) first (get "id"))
But I can I now loop through it?
You can simply use map.
(->> (get-in data ["photoset" "photo"])
(map #(str "http://www.flickr.com/" (get % "farm") "/" (get % "id"))))
It will yield the following list:
("http://www.flickr.com/9/8455893107" "http://www.flickr.com/9/8469482476")
I'm trying to configure the Shovel plugin for RabbitMQ with a list of declarations. I have configured my remote exchange to have an alternate-exchange when I created it.
My problem is that I can't get the config file for shovel to include this argument so RabbitMQ crashes upon startup.
This is what my config looks like:
[
{mnesia, [{dump_log_write_threshold, 100}]},
{rabbit, [{vm_memory_high_watermark, 0.4}]},
{rabbitmq_shovel,
[{shovels,
[{call_stats_shovel,
[{sources, [{broker, "amqp://guest:guest#localhost:5672/test"},
{declarations,
[{'queue.declare', [{queue, <<"incoming">>}, durable]},
{'exchange.declare',[{exchange, <<"my-exchange-topic">>},{type, <<"topic">>},durable]},
{'queue.bind',[{exchange, <<"my-exchange-topic">>},{queue, <<"incoming">>}]}
]}]},
{destinations, [{broker, "amqp://guest:guest#172.16.3.162:5672/blah"},
{declarations,
[
{'queue.declare',[{queue, <<"billing">>},durable]},
{'exchange.declare',[{exchange, <<"my-exchange-topic">>},{type, <<"topic">>},{alternate_exchange, <<"alt">>}, durable]},
{'queue.bind',[{exchange, <<"my-exchange-topic">>},{queue, <<"billing">>},{routing_key, <<"physical">>}]}
]}
]},
{queue, <<"incoming">>},
{ack_mode, no_ack},
{publish_properties, [{delivery_mode, 2}]},
{reconnect_delay, 5}
]}
]
}]
}
].
The problem is on the destination exchange called my-exchange-topic. If I take out the declarations section then the config file works.
This is the error:
=INFO REPORT==== 31-Jul-2012::12:15:25 ===
application: rabbitmq_shovel
exited: {{invalid_shovel_configuration,call_stats_shovel,
{invalid_parameter_value,destinations,
{unknown_fields,'exchange.declare',
[alternate_exchange]}}},
{rabbit_shovel,start,[normal,[]]}}
type: permanent
If I leave the alternate_exchange section out of the declaration I get this error in RabbitMQ web management:
{{shutdown,
{server_initiated_close,406,
<<"PRECONDITION_FAILED - inequivalent arg 'alternate-exchange'for exchange 'my-exchange-topic' in vhost 'blah':
received none but current is the value 'alt' of type 'longstr'">>}},
{gen_server,call,
[<0.473.0>,
{call,
{'exchange.declare',0,<<"my-exchange-topic">>,<<"topic">>,false,
true,false,false,false,[]},
none,<0.444.0>},
infinity]}}
For anyone looking at how to configure exchanges and queues that require additional arguments you do it like this:
{'exchange.declare',[{exchange, <<"my-exchange-topic">>},{type, <<"topic">>}, durable, {arguments, [{<<"alternate-exchange">>, longstr, <<"alternate-exchange">>}]} ]},
you can do a similar thing with queues:
{'queue.declare',[{queue, <<"my-queue">>},durable, {arguments, [{<<"x-dead-letter-exchange">>, longstr, <<"dead-letter-queue">>}]}]}
For clarification of the comment above, in case of an exchange2exchange shovel, the config would be:
{'exchange.declare',[{exchange, <<"my-exchange-topic">>},{type, <<"topic">>}, durable, {arguments, [{<<"alternate-exchange">>, longstr, <<"name-of-your-alternate-exchange">>}]} ]},
I am new to TK and I think the error message that I am getting is with TK. Here is the error message:
unknown option "-state"; must be one of -background, -bd, -bg, -borderwidth, -columnbd, -columnborderwidth, -columnrelief, -cursor, -exportselection, -fg, -fillcolumn, -font, -foreground, -height, -highlightbackground, -highlightcolor, -highlightthickness, -labelanchor, -labelbackground, -labelbd, -labelbg, -labelborderwidth, -labelfg, -labelfont, -labelforeground, -labelheight, -labelimage, -labelrelief, -labels, -relief, -resizablecolumns, -selectbackground, -selectborderwidth, -selectcommand, -selectforeground, -selectmode, -setgrid, -takefocus, -width, -xscrollcommand or -yscrollcommand
errorInfo trace:
unknown option "-state"; must be one of -background, -bd, -bg, -borderwidth, -columnbd, -columnborderwidth, -columnrelief, -cursor, -exportselection, -fg, -fillcolumn, -font, -foreground, -height, -highlightbackground, -highlightcolor, -highlightthickness, -labelanchor, -labelbackground, -labelbd, -labelbg, -labelborderwidth, -labelfg, -labelfont, -labelforeground, -labelheight, -labelimage, -labelrelief, -labels, -relief, -resizablecolumns, -selectbackground, -selectborderwidth, -selectcommand, -selectforeground, -selectmode, -setgrid, -takefocus, -width, -xscrollcommand or -yscrollcommand
while executing
"::mclistbox::Canonize $w option [lindex $args 0]"
(procedure "::mclistbox::WidgetProc" line 211)
invoked from within
"::mclistbox::WidgetProc .autoQuote.reportInfoTab.f.tit76.f.mcl84 cget -state"
("eval" body line 1)
invoked from within
"eval ::mclistbox::WidgetProc {.autoQuote.reportInfoTab.f.tit76.f.mcl84} $command $args"
(procedure ".autoQuote.reportInfoTab.f.tit76.f.mcl84" line 1)
invoked from within
"$w cget -state"
(procedure "tk::ListboxBeginSelect" line 18)
invoked from within
"tk::ListboxBeginSelect [::mclistbox::convert .autoQuote.reportInfoTab.f.tit76.f.mcl84.framecol1.listbox -W] [[::mclistbox::convert .autoQuote.reportIn..."
invoked from within
"if {[winfo exists [::mclistbox::convert .autoQuote.reportInfoTab.f.tit76.f.mcl84.framecol1.listbox -W]]} {
tk::ListboxBeginSelect [::mclistbox::conve..."
(command bound to event)
This isn't my code but it looks like it's going the Widget library. I have found the routine 'widgetProc' and it appears to have a '-state' switch. I am just drawing a blank right now.
Here is my environment:
Windows 7 Enterprise SP1.
tcl version: 8.5.11.1
bwidgets 1.95
iwidgets 4.0.1
tcllib 1.14
The error isn't caused by widgetProc, but rather by ::mclistbox::Canonize. Now unfortunately, I'm not familiar with it but a quick Google search shows this result with similar lack of resolution. However, the dates on the posting would lead me to make an optimistic suggestion that you upgrade to a more recent version if possible. If that is not possible, maybe you could show us the code you're using - it maybe possible that the way you're calling it is triggering the error.
I found a quick workaround. Not sure if it's entirely correct or not, but it worked for me.
Add the following under line 77 ( which should be "array set widgetOptions [list \" )
-state {State State} \
Would provide a diff, but it's such a simple fix I don't feel that it warrants it.