import os

os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from tensorflow.python.client import device_lib

print(device_lib.list_local_devices())

from Vnet.model_vnet3d import Vnet3dModule
import numpy as np
import pandas as pd
import tensorflow as tf


def train():
    '''
    Preprocessing for dataset
    '''
    # Read  data set (Train data from CSV file)
    csvmaskdata = pd.read_csv('MaskLiver.csv')
    csvimagedata = pd.read_csv('Image.csv')
    maskdata = csvmaskdata.iloc[:, :].values
    imagedata = csvimagedata.iloc[:, :].values
    # shuffle imagedata and maskdata together
    perm = np.arange(len(csvimagedata))
    np.random.shuffle(perm)
    imagedata = imagedata[perm]
    maskdata = maskdata[perm]
    Vnet3d = Vnet3dModule(128, 128, 64, channels=1, costname=("dice coefficient",)) #256-->128  16 -->1
    Vnet3d.train(imagedata, maskdata, "Vnet3d.pd", "log/diceVnet3d/", 0.001, 0.7, 10, 1) # This is creating weird directories , I think we need to get rid of some slashes. 

tf.reset_default_graph()
train()

import os

os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
from tensorflow.python.client import device_lib

print(device_lib.list_local_devices())

from Vnet.model_vnet3d import Vnet3dModule
import numpy as np
import pandas as pd
import tensorflow as tf


def train():
    '''
    Preprocessing for dataset
    '''
    # Read  data set (Train data from CSV file)
    csvmaskdata = pd.read_csv('MaskLiver.csv')
    csvimagedata = pd.read_csv('Image.csv')
    maskdata = csvmaskdata.iloc[:, :].values
    imagedata = csvimagedata.iloc[:, :].values
    # shuffle imagedata and maskdata together
    perm = np.arange(len(csvimagedata))
    np.random.shuffle(perm)
    imagedata = imagedata[perm]
    maskdata = maskdata[perm]
    Vnet3d = Vnet3dModule(128, 128, 64, channels=1, costname=("dice coefficient",)) #256-->128  16 -->1
    Vnet3d.train(imagedata, maskdata, "Vnet3d.pd", "log/diceVnet3d/", 0.001, 0.7, 10, 1) # This is creating weird directories , I think we need to get rid of some slashes. 

tf.reset_default_graph()
train()

Preprocessing for dataset # Read  data set (Train data from CSV file) # shuffle imagedata and maskdata together #256-->128  16 -->1 # This is creating weird directories , I think we need to get rid of some slashes.