u-net-with-multiple-classification's People
Forkers
liujie1977 bazingaauv lxygoodjob csie-lab-aug2021 syedsajidhussain nuhhatipoglu sundawei stenlyho gpetrak armindadras ovidedecroly khanhdat111 fahmina1319u-net-with-multiple-classification's Issues
系统找不到指定的路径。: '/data/catndog/train/image',已经建立了文件夹,怎么还是报错
D:\TONG\github\U-net-multiclass\model2.py:79: UserWarning: Update your Model
call to the Keras 2 API: Model(inputs=Tensor("in..., outputs=Tensor("co...)
model = Model(input=inputs, output=conv10)
Epoch 1/20
Traceback (most recent call last):
File "D:/TONG/github/U-net-multiclass/main.py", line 21, in
model.fit_generator(myGene, steps_per_epoch=100, epochs=20, callbacks=[model_checkpoint])
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\engine\training_generator.py", line 181, in fit_generator
generator_output = next(output_generator)
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 709, in get
six.reraise(*sys.exc_info())
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\six.py", line 693, in reraise
raise value
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 685, in get
inputs = self.queue.get(block=True).get()
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\multiprocessing\pool.py", line 644, in get
raise self._value
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\multiprocessing\pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras\utils\data_utils.py", line 626, in next_sample
return six.next(_SHARED_SEQUENCES[uid])
File "D:\TONG\github\U-net-multiclass\data.py", line 58, in trainGenerator
seed=seed)
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras_preprocessing\image.py", line 1013, in flow_from_directory
interpolation=interpolation)
File "C:\Users\Tong\AppData\Local\Programs\Python\Python36\lib\site-packages\keras_preprocessing\image.py", line 1875, in init
for subdir in sorted(os.listdir(directory)):
FileNotFoundError: [WinError 3] 系统找不到指定的路径。: '/data/catndog/train/image'
import ERROR
Traceback (most recent call last):
File "main.py", line 3, in
from model import *
File "C:\Users\GoLive_Erol\Desktop\Unet-with-multiple-classification\model.py", line 12, in
from tensorflow.contrib.opt import AdamWOptimizer
ModuleNotFoundError: No module named 'tensorflow.contrib'
i m using tf 2.3
请问如何开始?
感谢你的分享。
我不太懂程序里面的”Head“、”====“还有乱码是什么啊?
two questions
how about if we have more than 3 classes and how to predict if we have more than 3 classes?
Dice loss
Hello,
I wonder how to implement multi-class Dice loss?
Does it need to do the one-hot encoding?
Does someone know how to do it?
Thanks a lot.
关于mask数据的reshape
前辈您好,我刚接触分割,有个问题请教。
if(flag_multi_class): img = img / 255. mask = mask[:,:,:,0] if(len(mask.shape) == 4) else mask[:,:,0] mask[(mask!=0.)&(mask!=255.)&(mask!=128.)] = 0. new_mask = np.zeros(mask.shape + (num_class,)) ######################################################################## #You should define the value of your labelled gray imgs #For example,the imgs in /data/catndog/train/label/cat is labelled white #you got to define new_mask[mask == 255, 0] = 1 #it equals to the one-hot array [1,0,0]. ######################################################################## new_mask[mask == 255., 0] = 1 new_mask[mask == 128., 1] = 1 new_mask[mask == 0., 2] = 1 mask = new_mask
这里关于mask的reshape,我猜测组装的方式是:您是分了三类(猫狗和背景)。上面的操作是用类别数量设置mask的厚度,每一层代表一类。按您上面的代码设置为:第一层(0层)猫,您的标签应该是把猫标记成255,第二层是狗,您标记为128,第三层为背景您标记为0,让后将这三层对应标签位置的像素都设为1。不知道这样我的理解对不对。
您在训练是图像的读取方式还是gray
也就是说image和mask的初始形状都是(batch,w,h,1),batch假设等于2
然后img没有reshape操作,所以他的形状(2,256,256,1)
mask设置reshape,所以他的形状是(2,256,256,3)
我的数据为4类(包括背景)
按照上面的理解我出现了下面的问题
ValueError: Error when checking target: expected conv2d_24 to have shape (256, 256, 3) but got array with shape (256, 256, 4)
百思不得解
期待您的回复,再次感谢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.