stke9 / slicegan Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Add a requirements.txt file to enable easy quick-start with pip install -r requirements.txt
Hi there,
In networks.py we have:
if Training:
with open(pth + '_params.data', 'wb') as filehandle:
# store the data as binary data stream
pickle.dump(params, filehandle)
# if loading model, load the associated params file
else:
with open(pth + '_params.data', 'rb') as filehandle:
# read the data as binary data stream
dk, ds, df, dp, gk, gs, gf, gp = pickle.load(filehandle)
However, the file named '*_params.data' is not included in the repository. Can you please provide some guidance?
Thanks a lot
Hello,it's really a wonderful work. Could I ask how to save the trained 3D pore structure image as the stl format in the raytrace.py by optix for the following diffusion simulation. Thank you very much.
Hi
I'm glad to meet you.
My name is Asadullah.
I'm master student in Tokyo.
I ran with your code that you provided and generation with the images you use worked fine.
However, I tried to generate to 3D structure myself using the images 3 pieces and could not get it to work.
If you know how to do it, could you please let me know.
Hi,can I get the other data sets used for training in the paper,such as colour images used for training in the paper.ths.
Dear Steve,
as I just tested a arbitary image trying to generate a 3D structure using your SliceGAN,
I encountered the following issue:
File "run_slicegan.py", line 52, in
model.train(Project_path, image_type, data_type, data_path, netD, netG, img_channels, img_size, z_channels, scale_factor)
File "/work/scratch/ac01asac/SliceGAN/slicegan/model.py", line 104, in train
out_real = netD(real_data).view(-1).mean()
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1015, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 150, in forward
return self.module(*inputs, **kwargs)
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1015, in call_impl
return forward_call(*input, **kwargs)
File "/work/scratch/ac01asac/SliceGAN/slicegan/networks.py", line 55, in forward
x = F.relu(conv(x))
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1015, in _call_impl
return forward_call(*input, **kwargs)
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 443, in forward
return self._conv_forward(input, self.weight, self.bias)
File "/home/ac01asac/.local/lib/python3.8/site-packages/torch/nn/modules/conv.py", line 439, in _conv_forward
return F.conv2d(input, weight, bias, self.stride,
RuntimeError: Given groups=1, weight of size [64, 3, 4, 4], expected input[32, 238, 64, 64] to have 3 channels, but got 238 channels instead.
seems that there is some compatibility issue. I used the following image, and specified the type and name as requested in the run_slicegan.py file.
Would you also provide your NMC.tif file in the repo just to give a test?
Hello stke9,
Thank you for the nice work. I have one issue when running the dataset generation in the preprocessing using one tif image my own.
when running:
data = np.empty([32 * 900, len(vals), l, l])
i got erroa message that the np core issue, can not allocate 200 G memory for the array (28800, ?, 64, 64)
in data type 'float64' (forget the number of vals)
so my question is what the 32*900 means. i have a GPU with only 5 G memory size, can i change the value to something else?
however, when i use the input image with the NMC.tif in your Example file, i dont get the erroa. what could be the reason for this?
best regards,
OP
Hi,
First, thanks for developing such a great model.
I am testing training the model based on the test NMC image on a quadro p5000 before I move on to my own images. With the default settings the model uses about 5GB of GPU RAM and only 25% of GPU compute capacity. I have increased both the batch_size and D_batch_size to 24 since my GPU has 16GB of RAM. However, this has not made the model use any more GPU compute capacity (only increased the RAM usage). Is there something else I should change to allow the GPU to utilize it's full power?
Thanks,
Hannah
Hello Steven,
When the training loop went to
util.test_plotter(img, 5, imtype, pth)
a error occour and i checked the test_plotter function in util.py. Seems the code should be okey. at least i could not found a problem.
so i commented the line, the training went well just no test plot saved.
you might have a better idea?
best regards,
OP
Setting data_type='array'
causes an exception in preprocessing.batch
, that datasetxyz
is not defined, as 'array' is not used in any of the keywords. As a quick workaround, I added it to grayscale
part as it was appropriate for my data as follows:
...
elif data_type == 'grayscale' or data_type == "array":
datasetxyz = []
uniques = None
for img in data:
if data_type == "grayscale":
img = plt.imread(img)
else:
img = np.load(img)
...
It does run like this but I am not sure this is the correct solution/appropriate for the rest of the pipeline.
Hi,
Can you please say which version of python, pytorch and other modules you are using? And also if you have tested on multiple GPUs? I get quite a few strange errors when I use python 3.10, torch1.13.1, cuda11.7, torchvision0.14.1, torchaudio 0.13.1.
When I run on four GPUs (Tesla V100s) the generator will not load after training.
raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for Generator:
_pickle.UnpicklingError: A load persistent id instruction was encountered, but no persistent_load function was specified.
When I run on a single GPU the generator makes images of all zeros. However, the training slices snapshot shows a great image
I think it is probably due to the versions. Can you advise?
Thanks
Hannah
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.